无法加载文件或程序集“System.Net.Http”或它的一个依赖 [英] Could not load file or assembly 'System.Net.Http' or one of its dependencies

查看:2709
本文介绍了无法加载文件或程序集“System.Net.Http”或它的一个依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许相关信息:我有一个Web应用程序我.NET 4.5建成。我想将其部署到Azure中的网站,但它仅支持.NET 4.0,所以我降级的项目.NET 4.0。
它时在本地运行仍然有效。

Maybe Relevant information: I have a web application I built with .net 4.5. I wanted to deploy to Azure's Web Sites but it only supports .net 4.0 so I downgraded the project to .net 4.0. It still works when run locally.

当我发布到Azure中,我得到这个错误:

When I publish to Azure, i get this error:

无法加载文件或程序集System.Net.Http或它的一个依赖。找到的程序集清单定义不匹配程序集引用。 (异常来自HRESULT:0x80131040)

Could not load file or assembly 'System.Net.Http' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我曾尝试与的NuGet删除网页API和readding它,另一个问题上的SO建议,但我仍然有同样的问题。结果
我试图关闭/打开VS,清洁/内部版本。

I have tried removing the Web API with nuget and readding it, as another question on SO suggested but I still have the same problem.
I have tried close/open VS, and clean/build.

推荐答案

我通过除去参考问题参考(其指向我的.Net安装文件夹),并与在参考文件替换它解决类似的问题(System.Web.Http和System.Net.Http.Formatting)错误我封装了由Microsoft.AspNet.WebApi的NuGet包安装文件夹中。

I solved a similar problem (System.Web.Http and System.Net.Http.Formatting) error by removing the reference to problem reference (which was pointed to my .Net installation folder) and replacing it with the reference file in my packages folder that was installed by the Microsoft.AspNet.WebApi NuGet package.

这篇关于无法加载文件或程序集“System.Net.Http”或它的一个依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆