System.Net.Http的两个不同版本。本地vs DEV服务器

时间:2016-11-30 15:48:31

标签: c# asp.net dll

我有一个针对.NET v4.0的Asp>网站项目。我在项目中使用了System.Net.Http,并通过NuGet将其引入。在我的开发机器上一切正常,但是,当我部署到我的DEV服务器时,项目会因此错误而爆炸。

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)

请注意,我遇到了this posting from 2012,其中一个答案建议更改bindingRedirect值,如下所示。

<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="2.0.0.0"/>

这会修复DEV上的项目,但每次重新部署相同的修补程序都必须应用。在我看来,我有两个不同版本的System.Net.Http.dll。一个在我的本地机器上,一个在DEV上。如何在部署期间将System.Net.Http.dll的版本从开发计算机移动到DEV计算机上?

注意:我搜索了为System.Net.Http设置“Copy Local”的选项,但是没有选项可以在解决方案资源管理器中显示所有文件。也许这是一个网站项目而不是Web应用程序?

0 个答案:

没有答案
相关问题