【问题标题】:TFS Build is overwriting assemblies with incorrect versionTFS Build 正在用不正确的版本覆盖程序集
【发布时间】:2016-11-08 15:48:04
【问题描述】:

我正在开发一个使用 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)

有没有办法防止这种情况发生?

【问题讨论】:

  • 你能分享你的构建定义吗?您是否使用 Nuget 安装 System.Collections.Immutable 1.2.0 包?

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


【解决方案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>

其他有用的链接:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-15
    • 2023-03-11
    • 2011-07-05
    • 2016-10-07
    • 2017-07-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多