Reputation: 2857
I'm working on an ASP.NET 4.6.2 application that uses Entity Framework Core 1.0.1. The app builds and runs fine locally, however, TFS 2015 Update 3 builds and deploys it in a broken state. At least one (that I'm aware of right now) required assembly gets overwritten with an older version.
System.Collections.Immutable 1.2.0. is required by EF. However, in the build logs after 1.2.0 is copied to the bin folder, I can see that another version (1.1.37.0) is copied to bin. It's copied from the Microsoft.Net.Compilers.1.3.2 package and overwrites the newer version.
When the application runs, it expects to see 1.2.0, and instead finds 1.1.37. Then it throws this error:
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)
Is there a way to prevent this?
Upvotes: 0
Views: 327
Reputation: 31013
According to this website, this is a known issue, and the issue should be available in Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.2.
http://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform/
If the fix doesn't work, you can solve this issue by updating the Microsoft.CodeDom.Providers.DotNetCompilerPlatform package, the binding-redirect solution is the simplest workaround now.
<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>
Other useful links:
Upvotes: 1