I created a console project in net core. In debug works perfectly, in publish works perfectly, when using DevOps pipeline the artifacts build with no errors but when deployed to test server I get this error
The process was terminated due to an unhandled exception.
Exception info: System.IO.FileLoadException. Could not load assembly Microsoft.Extensions.DependencyModel,
Version 2.1.0 ...
The located assembly’s manifest definition does not match the assembly reference.
Exception from HRESULT: 0x80131040
I’ve searched for references in the included projects but haven’t found any. I believe it might be spawning from a serilog package but am not sure.
The located assembly’s manifest definition does not match the assembly reference.
It seems the a known issue in .NET Core 2.1.x that was fixed in .NET Core 2.1.5 and newer.
So, If you are getting failures due to "System.IO.FileLoadException
" when you build/publish .NET Core project, you are probably running into this issue:
Version mismatches in 2.1 and 2.2 patch updates (often causes FileLoadException)
To fix this issue, you can try to upgrade .NET SDK version to 2.1.5
or newer.
You can use .NET Core Tool Installer task in your release pipeline to update it.
If it not work for you, you can update the project to:
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3" />
Hope this helps.
User contributions licensed under CC BY-SA 3.0