无法编译,因为系统dll的版本已更改 [英] Can't compile because versions of system dlls have changed

查看:125
本文介绍了无法编译,因为系统dll的版本已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.Net Framework 4.7.03056运行VS 2015 版本14.0.25431.01 Update 3.

I'm running VS 2015 Version 14.0.25431.01 Update 3 with .Net Framework 4.7.03056.

上周四,我编译了一个发布的源代码,一切正常。 我们的网络推出了KACE更新,周五早上我进来编译时,我的代码失败了。  1它说没有找到log4net。所以
我从NuGet重新加载了它。 我试图再次编译,我收到一条消息"无法加载文件或程序集System.Net.Http.Formatting版本:5.2.7 当我在Solution Explorer中查看我的dll属性时,它们是v4.0.30319和版本5.2.3.0的运行时版本
。 我从Web.Config中删除了以下

Last week on Thursday I compiled my source code for a release and everything worked fine.  Our network pushed out a KACE updated and on Friday morning when I came in and did a compile, my code failed.  1st it said that log4net was not found. So I reloaded that from NuGet.  I attempted to compile again and I got a message that "Could not load file or assembly System.Net.Http.Formatting version: 5.2.7  When I look at the properties of my dll in Solution Explorer they are Runtime Version of v4.0.30319 and Version 5.2.3.0.  I removed from Web.Config the following

<dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
      </dependentAssembly>

我也为其他一些Asstemblies做了这个。 然后编译仍然失败。

I did this for some other Asstemblies as well.  Then the compile still failed.

这是我详细构建的详细信息

Here is the verbosity of my build in detail

 There was a conflict between "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
2>      "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
2>      References which depend on "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll].
2>          C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
2>            Project file item includes which caused reference "C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll".
2>              System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
2>      References which depend on "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Dev\MIC Shared Assemblies\MIC.Shared\MIC.Shared\bin\Debug\System.Web.Http.dll].
2>          C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll
2>            Project file item includes which caused reference "C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll".
2>              System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
2>          C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.Cors.5.2.3\lib\net45\System.Web.Http.Cors.dll
2>            Project file item includes which caused reference "C:\Dev\Nova-Phase2_Actuate\MIC - Main Trunk\packages\Microsoft.AspNet.WebApi.Cors.5.2.3\lib\net45\System.Web.Http.Cors.dll".
2>              System.Web.Http.Cors, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
2>          C:\Dev\MIC Shared Assemblies\MIC.Shared\MIC.Shared\bin\Debug\MIC.Shared.dll
2>            Project file item includes which caused reference "C:\Dev\MIC Shared Assemblies\MIC.Shared\MIC.Shared\bin\Debug\MIC.Shared.dll".
2>              C:\Dev\MIC Shared Assemblies\MIC.Shared\MIC.Shared\bin\Debug\MIC.Shared.dll

我不知道明白为什么会发生这种情况。 我从一天到下一天没有对项目进行任何更改。  

I don't understand why this is occuring.  I didn't make any changes to the project from one day to the next.  

任何人都可以解释发生了什么以及如何解决这个问题吗?

Can anyone explain what is happening and how I go about fixing this?

谢谢

Bob




推荐答案

嗨JrNona,

欢迎来到MSDN论坛。

你能告诉我项目类型吗?

" 我们的网络推出了KACE更新 ",
你能解释什么是KACE吗?像这样:
https://www.quest.com/kace/

"Our network pushed out a KACE updated", could you explain what’s KACE? Like this: https://www.quest.com/kace/ ?

" 我进来编译,我的代码失败了。   "
你的意思是你修改或添加项目中的东西吗?

我看到了你在这里分享的脚本和警告信息。基于详细程度"在System.Web.Http之间存在冲突,Version = 5.2.3.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35"
和"System.Web.Http,Version = 5.2.7.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35。"显示
您无法将程序集版本5.2.3.0更改为5.2。 7.0因为它是主要的。
重新加载的NuGet包log4net可能匹配版本是5.2.7.0,但您的项目默认主要是5.2.3.0。我建议你检查一下你的配置并确定需要哪个log4net版本。

I saw the script and the warning info you shared here. based on the verbosity "There was a conflict between "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35." shown that you could not change the assembly version 5.2.3.0 to 5.2.7.0 because it was primary. the reloaded NuGet package log4net possible match version is 5.2.7.0, but your project default primarily is 5.2.3.0. I suggest you check your configuration and be sure which log4net version required.

另一方面,我们的论坛主要关注VS IDE问题,建议你修VS 2015,参见:

如何修复VS
。在修复VS之后,为了重新构建你的项目,如果它仍然无效,我们可以消除VS本身的原因。我怀疑这似乎与您的项目本身有关,我需要您分享更多项目信息,我会帮助您选择合适的
论坛以获得更好的支持。

In other hand, our forum is mainly focus on VS IDE issue, I suggest you to repair VS 2015, see: how to repair VS. After repairing VS, to re-build your project, if it still not works, we can eliminate the cause of VS itself. I suspect that seems related your project itself, I need you share more project info and I will help you to select appropriate forum for a better supporting.

< span style ="line-height:107%; font-family:'Segoe UI',sans-serif">期待您的回复。

Br

可能


这篇关于无法编译,因为系统dll的版本已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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