[英]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.我已将 NuGet Google.AdWords 24.10.1 package 添加到 .net 核心控制台应用程序中。 In the SDK documentation they say that .net core is supported.在 SDK 文档中,他们说支持 .net 内核。 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"} 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?我不明白核心应用程序是否支持这个 package?
This line causes a crash: AdWordsUser user = new AdWordsUser();
此行会导致崩溃: 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.所以我的 Adwords 代码在旧的 .net 项目中,该项目设置为 .net 4.6... 不得不切换到 .net 4.7.2 并重新安装所有 nugget 包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.