加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 无法使用ASP.NET(MVC 4)加载文件或程序集System.

发布时间:2020-12-16 09:53:52 所属栏目:asp.Net 来源:网络整理
导读:我跟着 Could not load file or assembly System.Net.Http,Version=4.0.0.0 with ASP.NET (MVC 4) Web API OData Prerelease 我按照你的建议步骤.我使用Unity.我在Boostrapper.Initialize上获得了一个问题.此问题说“SupportCours2.dll中发生类型’System.IO
我跟着 Could not load file or assembly System.Net.Http,Version=4.0.0.0 with ASP.NET (MVC 4) Web API OData Prerelease

我按照你的建议步骤.我使用Unity.我在Boostrapper.Initialize上获得了一个问题.此问题说“SupportCours2.dll中发生类型’System.IO.FileLoadException’的异常,但未在用户代码中处理

附加信息:

Could not load file or assembly 'System.Web.Http,Version=5.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" and in the inner I have {"Could not load file or assembly 'System.Web.Http,Version=4.0.0.0,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 
The located assembly's manifest definition does not match the assembly reference. 
(Exception from HRESULT: 0x80131040)":"System.Web.Http,PublicKeyToken=31bf3856ad364e35"}

内部和顶部的奇怪版本4.0是5.0

我尝试了很多东西:我遵循upprade http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2,在哪里可以找到一个NuGet包升级到System.Web.Http v5.0.0.0?并且无法使用ASP.NET(MVC 4)Web API OData预发布加载文件或程序集System.Net.Http,Version = 4.0.0.0

我还通过使用“pre”版本并修改web.config来遵循您的提议.我没工作.

你能帮我吗?

最好的问候,亚历山大

解决方法

这个对我有用:
写在“包管理器控制台”上

Update-Package Microsoft.AspNet.WebApi -reinstall

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读