TFS Build用不正确的版本

时间:2016-11-08 15:48:05

标签: asp.net entity-framework tfs entity-framework-core

我正在使用Entity Framework Core 1.0.1的ASP.NET 4.6.2应用程序。该应用程序在本地构建并运行良好,但是,TFS 2015 Update 3构建并在破坏状态下部署它。至少有一个(我现在都知道)需要用旧版本覆盖程序集。

System.Collections.Immutable 1.2.0。是EF要求的。但是,在将1.2.0复制到bin文件夹后的构建日志中,我可以看到另一个版本(1.1.37.0)被复制到bin。它从Microsoft.Net.Compilers.1.3.2包中复制并覆盖较新版本。

当应用程序运行时,它期望看到1.2.0,而是找到1.1.37。然后它抛出了这个错误:

Could not load file or assembly 'System.Collections.Immutable,
Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
or one of its dependencies. The located assembly's manifest
definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

有没有办法阻止这种情况?

1 个答案:

答案 0 :(得分:1)

根据this website,这是一个已知问题,该问题应该在Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.2中提供。

http://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform/

如果修复程序不起作用,您可以通过更新Microsoft.CodeDom.Providers.DotNetCompilerPlatform包解决此问题,绑定重定向解决方案现在是最简单的解决方法。

<dependentAssembly>
    <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.1.36.0" />
</dependentAssembly>

其他有用的链接: