简体   繁体   中英

AdWords SDK looks for System.Web reference in .net core app

I have added the NuGet Google.AdWords 24.10.1 package to a .net core console app. In the SDK documentation they say that .net core is supported. The problem is that the library functions crash on first call with tho following error:

Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.":"System.Web.Hosting.HostingEnvironment"}

I cant understand if this package is supported or not in the core app?

This line causes a crash: AdWordsUser user = new AdWordsUser();

So my Adwords code was inside old .net project that was set to .net 4.6... Had to switch to .net 4.7.2 and reinstall all nugget packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM