简体   繁体   English

AdWords SDK 在 .net 核心应用程序中查找 System.Web 参考

[英]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.

相关问题 可以在Kestrel上自托管剃刀Web应用程序的.NET Core应用程序可以在完整的.NET和参考system.web上运行吗? - Can a .NET Core app, self hosting razor web app on Kestrel, run on full .NET and reference system.web? <system.web> .net核心中的全球化 - <system.web> globalization in .net core ASP.NET 中缺少“System.web”引用 - Missing “System.web” reference in ASP.NET 将System.Web参考添加到Windows 10 Universal App - Add System.Web Reference To A Windows 10 Universal App ASP.NET 5 Web api模板,未解析的参考System.Web - ASP.NET 5 Web api template, unresolved reference System.Web .NET 标准类库中的 System.Web - System.Web in .NET Standard Class Library .NET代码System.Web安装源 - .NET Code System.Web install source .NET 标准中的 HttpContextBase 和 System.Web - HttpContextBase and System.Web in .NET Standard .net 核心 2.2 中的命名空间“System.web”中不存在类型或命名空间名称“HttpBrowserCapabilitiesBase” - the type or namespace name 'HttpBrowserCapabilitiesBase' does not exist in the namespace 'System.web' in .net core 2.2 Request.Url.AbsoluteUri在ASP.NET Core 2.0中不起作用(使用System.Web) - Request.Url.AbsoluteUri not working in asp.net core 2.0 (Using System.Web)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM