.netcore 1.1 "assembly's manifest definition does not match the assembly reference" - asp.net-core

I have a working .netcore 1.1 app running with net451.
I changed the target framework to net462, cleared out bin/nuget packages, rebuilt everything/dotnet restore and it compiled fine.
When I access a method from the System.Http.Net library, the app throws the following exception.
System.IO.FileLoadException: Could not load file or assembly
System.Diagnostics.DiagnosticSource, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) File name:
'System.Diagnostics.DiagnosticSource, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 at
System.Net.Http.WinHttpHandler.SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
How do I further debug this issue? I'm using win10-x64 and vs2017 RC.

I had the same issue. After updating .Net Core SDK to the latest version, the problem has been disappeared.

Related

Configure assemblies redirection for a Burn-based boostrapper

We're developing a Burn-based setup, with a custom UI.
The custom UI project uses .NET Framework 4.8.
We're trying to use AutoFac 6.3.
When run, the setup fails with the following exception:
"System.IO.FileLoadException
Message=Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
This happens because the bundle uses the Microsoft.Bcl.AsyncInterfaces NuGet package version 6.0.0.0, while the AutoFac assembly references the Microsoft.Bcl.AsyncInterfaces.dll version 1.0.0.0
How can we instruct the bootstrapper to redirect the Microsoft.Bcl.AsyncInterfaces assemblies to version 6.0.0.0? Is there a burn.config file we could use for that, similar to the app.config files?
BootstrapperCore.config is the app.config.

Imageresizer Faces Plugin Error

After installing this both manually and via the package manager I continue to see this error. I was wondering if any of you have encountered this. I get this when I use the ?f.detect=true.
{"dx":0.0,"dy":0.0,"dw":800.0,"dh":510.0,"ow":800.0,"oh":510.0,"cropx":0.0,"cropy":0.0,"cropw":800.0,"croph":510.0,"features":null,"message":"Could
not load file or assembly 'OpenCvSharp, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=6adad1e807fea099' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)"}

Implementation of Dropbox API ASP.NET Core

I am trying to consume the Dropbox API in the ASP.NET Core framework, but I am getting the following error:
'Could not load file or assembly 'System.Net.Http, Version=4.1.1.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)'.
I have installed the Dropbox API using the NuGet command Install-Package Dropbox.Api.
I am attaching a screenshot of the error below.

Assembly in host store has a different signature than assembly in GAC

I have added a third party dll (Extreme.Numerics.Net20.dll to my sql server assemblies). I then opened by VS 2008 project and added that assembly as a reference. Then I built and released my project and it created a PowerstatRegression.dll. Then I add that assembly to SQL Server as well. But when I run my code, I still get this:
Error message: System.IO.FileLoadException: Could not load file or assembly
'Extreme.Numerics.Net20, Version=3.6.10055.0, Culture=neutral,
PublicKeyToken=9e513770f58567b2' or one of its dependencies. Assembly in host store has a
different signature than assembly in GAC. (Exception from HRESULT: 0x80131050) File name:
'Extreme.Numerics.Net20, Version=3.6.10055.0, Culture=neutral,
PublicKeyToken=9e513770f58567b2' at
PowerStatRegression.matrix.MatrixHandler.MultiplyMatrixByArray(Double[][] a, Double[] b) at
Why is this happening? Everything builds correctly with no errors.
Change your CREATE ASSEMBLY to ALTER ASSEMBLY and rerun that on the server, that will update the GAC.

Fluent NuGet messed up

I have a solution with several projects. I changed a couple of references for Fluent nHibernate to NuGet packages (v1.3.0.717). Recently I changed another project and added the current Fluent package, 1.2.0.712 (earlier but current) and my app will build but not run. The current version points to nHibernate v3.1.0.4 but somewhere it clashes with v3.2.9.4000 which the previous version of Fluent referenced.
Inner Exception
{"Could not load file or assembly 'NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"
NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4"}
Exception
Could not load file or assembly 'NHibernate, Version=3.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
What do I do to clean this project up and get it running again?
Just remove all NHibernate/Fluent Nhibernate related packages and run command
Install-Package FluentNHibernate -Version 1.3.0.717
It will install correct package for you.
For some reason this package is not marked as current version. That is why Nuget gives you old one.