asp.net-web-api – Web Api:找不到System.Net.Http版本2.0.0.0
发布时间:2020-11-17 10:56:09 所属栏目:asp.Net 来源:互联网
导读:当我为WebApi安装NuGet包时,它给了我1.0.0.0版的System.Net.Http,但它引用了版本2. 我似乎无法找到我的生活版本2.当我下载.net 4.5时,我得到System.Net.Http版本4.0.315.x,但我不能使用它,因为Web Api程序集引用版本2.0.0.0. 有谁知道我在哪里可以找到这个版
当我为WebApi安装NuGet包时,它给了我1.0.0.0版的System.Net.Http,但它引用了版本2. 我似乎无法找到我的生活版本2.当我下载.net 4.5时,我得到System.Net.Http版本4.0.315.x,但我不能使用它,因为Web Api程序集引用版本2.0.0.0. 有谁知道我在哪里可以找到这个版本2.0.0.0?我已经尝试过NuGet包管理器,mvc4,.net 4.5,没有什么能给我版本2. 提前致谢. 解决方法在< system.web>下的Web.config文件中添加以下配置节点(假设您的应用程序在.NET 4.5上运行,targetFramework属性设置为4.5):<compilation targetFramework="4.5"> <assemblies> <add assembly="System.Net.Http,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" /> </assemblies> </compilation> 还要在< configuration>下的根级添加以下一个.节点: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> 这应该可以解决您的问题. (编辑:甘南站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.net WebAPI跨域调用问题的解决方法
- asp.net-mvc – 从ASP.NET Web API返回一些字段
- asp.net – VirtualPathUtility.ToAbsolute()VS. Url.Conte
- asp.net-mvc – 为什么在视图引擎中指定位置时,viewstart文
- asp.net-mvc – Asp .Net Core – 无法安装Microsoft.AspNe
- 如何配置asp.net进程在域帐户下运行?
- asp.net – Silverlight初始化错误2110 Internet Explorer
- asp.net-mvc – 在MVC ActionLink中使用Knockout绑定
- asp.net – 什么是system.globalization它和本地化有什么区
- asp.net-mvc-3 – 依赖注入与多个类实现的接口
推荐文章
站长推荐
- 验证 – Asp.Net MVC:子请求的执行失败.请查看I
- asp.net-mvc – 如何使用ASP.NET MVC ApiControl
- ASP.NET Core Web API操作的永久承载令牌身份验证
- 如何重定向到ASP.NET MVC中的调用页面?
- asp.net-mvc – .Net 4.5.1框架的maxRequestLeng
- asp.net – IIS Express(WebMatrix)打开外部连接
- .net – 有人有一个例子,说明为什么我会主持一个
- IIS ASP.NET WebApi在请求同一台服务器时死锁
- asp.net – MVC 4导出到CSV – 另存为对话框在Ch
- Plone和Asp.Net集成
热点阅读