I have problem with loading Autofac assembly on runtime in NET Core 3.1. In my project I have never use version 4.9.4, I have referenced only 6.3.0 version.
On starting application I get error
Topshelf.HostFactory Error: 0 : An exception occurred creating the
host, System.IO.FileLoadException: Could not load file or assembly
'Autofac, Version=4.9.4.0, Culture=neutral,
PublicKeyToken=17863af14b0044da' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
File name: 'Autofac, Version=4.9.4.0, Culture=neutral,
PublicKeyToken=17863af14b0044da'
My question is how to determine which assembly try to call Autofac in version 4.9.4?
How can I improve my logs to get such information?
Problem occurs on PROD env so we cannot use WinDbg or Fuslogvw.
Related
looks like I have a binding redirects issue that I don't know how to solve.
When .Build() is called, I get the following exception:
[2020-10-09 14:09:28.806] [ :001] [ERROR] [DatabaseClient ] Failed to connect to Cassandra Database...
System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.6.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)
File name: 'System.Threading.Tasks.Dataflow, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Cassandra.ProtocolEvents.ProtocolEventDebouncer..ctor(ITimerFactory timerFactory, TimeSpan delay, TimeSpan maxDelay)
at Cassandra.Cluster..ctor(IEnumerable`1 contactPoints, Configuration configuration)
at Cassandra.Cluster.BuildFrom(IInitializer initializer, IReadOnlyList`1 nonIpEndPointContactPoints, Configuration config)
at OpportunityRecorder.DatabaseClient.<ConnectToCassandraAsync>d__12.MoveNext() in C:\Gitlab-Runner\builds\4Gddire9\0\dev\V\OpportunityRecorder\OpportunityRecorder\DatabaseClient.cs:line 46
I have another project in this solution that references System.Threading.Tasks.Dataflow, Version=4.11.1.0.
This error doesn't happen locally, but happens when I deploy my application.
How can I fix this?
Can you try installing System.Threading.Tasks.Dataflow, Version=4.11.1.0 in the project that uses the DataStax driver?
Looks like there were two assemblies being references by the same set of projects, but with different versions. What I did was add both <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> and <PreserveCompilationContext>true</PreserveCompilationContext> to my .csproj file for my StartUp (main) project. This generated a binding reference in my App.config that would point all earlier versions of the assembly to a single version amongst all projects.
I am in front of a feature freeze in less than a week and I am looking for a way to upgrade Microsoft.Owin in one project only and keep referencing the old versions in other projects.
The goal under the hood is to use Microsoft.Owin.Security.OpenIdConnect with the version 4.1.0 providing me the support of AuthorizationCode flow.
My project is a C#, .NET web server using Owin.
PS : I am asking for a solution that doesn't modify the other project's *.csproj or *.config
And when I build and launch it, I got this error in the event viewer because there is a binding redirect on other projects that reference the version 3.1.0
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Owin.Hosting, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Owin.Hosting, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
I am trying to update the NewtonSoft to it's latest addition 11.0.1 but when I updated the Dll using NuGet Manager then it started givng me this Error I even Deleted files from all the Temp folders that could be there for the ASP.NEt FrameWork but it seems not to be going away.
Error:
Reference.svcmap: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
What else can I try doing here?
Rebuilding the solution usually fixes this error for me
In my WPF application targeting .NetFramework 4.6
I have a button which is "bind" to a public ICommand
After launch of the application, when I click on the button I get the error
System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime, Version=4.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)'
This happens intermittently.
it turns out my solution reference another project that reference a different version of the framework..
once i removed that it works
in C# windows forms, I am creating a chat client to connect nodejs server (Socekt.io). I am using SocketIoClientDotNet.dll in C#. While in visual studio debug mode, all is well. But when I install the app through creating the installer of the app, it is giving the following error when I call the socket.Emit('func',data) function.
Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
This is the line where exception is occurring:
socket.Emit("msg", "text", txtMessage.Text, receiverId, senderId);
Make sure the Newtonsoft.Json.dll file is included in the installer.
You could also try (re)installing the SocketIoClientDotNet using NuGet.
PM> Install-Package SocketIoClientDotNet