Windows error 0x80131040, -2146234304

Detailed Error Information

FUSION_E_REF_DEF_MISMATCH[1]

Message"The located assembly's manifest definition does not match the assembly reference."
Comment The located assembly's manifest definition does not match the assembly reference.

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode19 (0x013)
NameFACILITY_URT[2][3]
DescriptionThe source of the error code is .NET CLR.[2][3]
Error Code4160 (0x1040)

Questions

634votes
43answers

The located assembly's manifest definition does not match the assembly reference

I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error: > System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly [...] read more
c#
reference
compiler-errors
dependencies
version
209votes
40answers

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

I am getting the Error > System.IO.FileLoadException : Could not load file or assembly 'Newtonsoft.Json, Version=4.5.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) for my CI build Solution which I tried <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" [...] read more
asp.net
json.net
179votes
29answers

Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. Manifest definition does not match the assembly reference

Things I've tried after searching: 1. in Web.Config put a binding on the old version: <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.1.0" /> </dependentAssembly> 2. Edit my .csproj file to make sure there is only one Newtonsoft reference <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <SpecificVersion>False</SpecificVersion> <Private>True</Private> </Reference> [...] read more
json
json.net
.net-assembly
133votes
14answers

Could not load file or assembly System.Web.Http.WebHost after published to Azure web site

I created a web project and it runs well in Visual studio. However, I got the following error after published it to azurewebsites. What can cause the issue? > Could not load file or assembly 'System.Web.Http.WebHost, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does [...] read more
asp.net
asp.net-mvc
visual-studio
azure
azure-web-sites
125votes
20answers

.Net picking wrong referenced assembly version

I just copied an existing project to a brand new machine to start developing on it and have run into a problem with the version of one of my referenced assemblies (a telerik DLL as it happens). The project originally referenced an older version of the assembly (lets call it [...] read more
asp.net
dll
76votes
22answers

Could not load file or assembly 'Antlr3.Runtime (1)' or one of its dependencies

I'm getting this error while trying to run my MVC4 project, it was working fine until last time on my other machines, but when I'm trying to run it from another machine it's giving me this error: > Could not load file or assembly 'Antlr3.Runtime (1)' or one of its [...] read more
.net
asp.net-mvc
35votes
7answers

Could not load file or assembly 'WebGrease' or one of its dependencies

When i run my MVC4 Web application it gives me following error: Could not load file or assembly 'WebGrease' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled exception occurred during the execution of the current [...] read more
c#
asp.net-mvc
asp.net-mvc-4
kendo-ui
31votes
5answers

Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.1.0.0

I have a .NET Standard 1.4 class library that references the System.ComponentModel.Annotations (4.3.0) NuGet package. I'm then referencing this class library from a .NET Framework 4.6.2 test project. It builds fine, but at runtime I get the following error: > System.IO.FileLoadException occurred HResult=0x80131040 Message=Could not load file or assembly 'System.ComponentModel.Annotations, [...] read more
.net
visual-studio-2017
.net-standard
.net-standard-1.4
28votes
8answers

Could not load file or assembly System.Net.Http version 4.1.1.0

I'm porting a Net Framework 4 dll to Net Core. When porting my unit tests project I get an exception running some specific tests (not all). > System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not [...] read more
c#
.net
.net-core
porting
.net-framework-version
26votes
6answers

Could not load file or assembly Microsoft.CodeAnalysis

I have a webproject I am trying to host, but when the server tries to compile it, I get the following error: > Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the [...] read more
c#
visual-studio
26votes
11answers

Assembly binding redirect does not work

I'm trying to set up an assembly binding redirect, using the following app.config: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.AnalysisServices" PublicKeyToken="89845dcd8080cc91" /> <bindingRedirect oldVersion="10.0.0.0" newVersion="9.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration> I'm running the program on a machine with version 9.0.242.0 in the GAC, with the specified public key token. The [...] read more
c#
.net
binding
assemblies
reference
15votes
3answers

Could not load file or assembly 'System.Web.Mvc' . How to use the correct reference?

I have an application built on ASP.NET web forms which also supports MVC 5. I included MVC 5 API controllers in my project for which I had to upgrade Json from version 4.5 to 7.0. After making those changes when I launched the application, I get the following error: > [...] read more
asp.net
.net
asp.net-mvc
asp.net-mvc-5
14votes
5answers

Could not load file or assembly 'Microsoft.AspNetCore.Connections.Abstractions' on ASP.NET Core only on Windows PC

This ASP.NET Core 2.1 Project runs fine on my Mac OS. However it throws this exception when I run it from Windows PC. I tried to run this from two Windows machines using the same version of .NET Core SDK. I tried reinstalling .NET Core SDK 2.1.302, also tried upgrading [...] read more
asp.net-core
.net-core
10votes
4answers

Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.1.1

I’m trying to upgrade a project from MVC 4/EF 5 to MVC 5/EF 6. I updated the framework from 4.5 to 4.5.1 and then from NuGet updated the Solution MVC (4.0.30506.0 to 5.1.1) and EntityFramework (5 to 6.1.1). This pulled in a Razor dependency (2.0.30506.0 to 3.1.1) and WebPages (2.0.30506.0 [...] read more
razor
asp.net-mvc-5
entity-framework-6
9votes
4answers

AspNetCore Abstractions could not load

I use ASP.NET Core + Angular 2 template for Visual Studio. I have updated my project.json file and it looks now (part of it): "dependencies": { "Microsoft.AspNetCore.AngularServices": "1.0.0-*", "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0-preview1-final", "Microsoft.AspNetCore.Diagnostics": "1.1.0-preview1-final", "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.0-preview1-final", "Microsoft.AspNetCore.Identity": "1.1.0-preview1-final", "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0-preview1-final", "Microsoft.AspNetCore.Mvc": "1.1.0-preview1-final", "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview3-final", "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-preview1-final", "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-preview1-final", "Microsoft.AspNetCore.StaticFiles": "1.1.0-preview1-final", "Microsoft.EntityFrameworkCore": "1.1.0-preview1-final", [...] read more
asp.net-core
.net-core
9votes
1answer

Could not load file or assembly 'Autofac, Version=3.0.0.0

I am trying to connect enFinder file manager to my asp.net project with this connector. I added Autofac Version 3. Afterwards I removed the reference and added a reference to Autofac 2.6. Now the following error occurs: Could not load file or assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of [...] read more
asp.net
autofac
8votes
3answers

Newtonsoft.Json reference complaining on Azure Functions

I'm running an Azure Functions, called SmsWebhook. It calls a method in an external assembly, AzureFunctionsSample.Services.dll that has a reference to Newtonsoft.Json 8.0.3 The details of my Run.csx looks like: #r "AzureFunctionsSample.Services.dll" using System.Net; using AzureFunctionsSample.Services public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { ... } Within the Run() [...] read more
c#
azure
azure-functions
8votes
2answers

Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation

I am getting this error whenever I try and run a webjob project with application insight and entity framework. > System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=0.0.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: [...] read more
c#
azure
azure-application-insights
webjob
interopservices
5votes
2answers

Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0 in combination with Microsoft.AspNet.WebApi.Client

I’m coding a class library (called mylibrary.dll) that itself references some more libraries -> uses the following DLLs (taken from package.config for version overview): <package id="EntityFramework" version="6.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" /> <package id="System.Data.SQLite" version="1.0.99.0" targetFramework="net45" /> <package id="System.Data.SQLite.Core" version="1.0.99.0" targetFramework="net45" /> <package [...] read more
c#
dll
reference
json.net
.net-assembly
4votes
2answers

reference .Net framework 4.5.2 from .Net Core 2.0 project

I have spent a few hours trying to figure out why .Net Core 2.0 wouldn't load .Net framework 4.5.2 nuget packages. Now I think it's time to ask... What happens is I have a .Net Core 2.0 WebApi app (A) and I want to reuse my .Net framework 4.5.2 library(B). [...] read more
.net
asp.net-core-2.0
.net-framework-version
4votes
2answers

FileLoadException: Could not load file or assembly System.Runtime, Version=4.2.0.0

I have an asp.net core 2.0 application that runs on full .net framework 4.6.1. It works fine locally but when I deploy it to Azure I receive the following error: > 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 [...] read more
.net
asp.net-core
.net-core
3votes
1answer

Is it possible to use the signed RestSharp NuGet package with Twilio?

We're using both DocuSign's API which requires the signed version of RestSharp, and we're looking to integrate Twilio which requires the unsigned version. I've spent a bit of time trying to get both DLLs to resolve for each of their dependencies, and haven't had any luck. At this point, I'm [...] read more
c#
.net
twilio
restsharp
3votes
3answers

Can not load assembly for 'Microsoft.Owin'

I have an issue in asp.net web API where when I add Signlr class I get. I can see in the references Microsoft.Owin > Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. >The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: [...] read more
asp.net
visual-studio
asp.net-web-api
owin
2votes
1answer

Deploying MVC 5.1 app on web server

I made ASP.NET application with MVC 5.1 technology and tried to deploy it on Winhost server. When I go to my web site, I get the following error message. Could not load file or assembly 'System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does [...] read more
asp.net
windows
mvc
2votes
1answer

Cannot load System.ComponentModel.Annotations from OrmLiteConfigExtensions (ServiceStack.OrmLite.Core)

I get a runtime error when using ServiceStack.OrmLite.Core package (5.4.1) and trying to get a ModelDefinition (ServiceStack.OrmLite.ModelDefinition) by doing: var model = ModelDefinition<T>.Definition; The error reads as follows: System.IO.FileLoadException: 'Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does [...] read more
c#
.net
.net-core
servicestack
ormlite-servicestack
2votes
1answer

ASP.NET Core MVC project fails to load assembly

I'm building a website using ASP.NET Core MVC. I have a problem and don't know how to solve it. I've created a separate project (.Net Core Library) and implemented some methods in it to use in the main project. I've added the library to my ASP.NET Core MVC project and [...] read more
.net-core
asp.net-core-mvc
asp.net-core-2.2
2votes
2answers

Exception while saving to Raven

I'm getting an exception while trying to save an entity to Raven in one of our environments. Here are details: Application Target Framework: .NET Core 2.1 RavenDB.Client Version: 4.1.2 .Net Core Runtime and Hosting Bundle installed on the server: 2.0.5 2.1.3 2.1.6 2.2.0 (We have multiple versions installed since it [...] read more
.net-core
ravendb
asp.net-core-2.1
2votes
4answers

Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ASP.NET MVC

I went through many answers that answered before but I'm not lucky to find a solution of my problem. This Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and many others I used. ****Here is the runtime error:**** Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' [...] read more
asp.net-mvc
2votes
1answer

AjaxControlToolkit.CalendarExtender and System.Web.Extentions version error

I have VS 2005, 2008 on my dev box. New project from other developers who only have 2005 installed. When I build it I get error. > Error 1 Indirect reference is being made to assembly System.Web.Extensions version 3.5.0.0, which contains 'AjaxControlToolkit.CalendarExtender'. This Project references a prior version of System.Web.Extensions [...] read more
visual-studio
ajaxcontroltoolkit
2votes
2answers

How to load same assembly of different version in one application?

I have Windows forms application in C#. I am in need to make use of the below dll. Interop.SHDocVw.dll The problem is that I need to refer two different versions of this same assembly. I tried keeping the dll in two different locations & tried to add but not allowing. [...] read more
c#
.net
.net-assembly
2votes
0answers

Auth0 LoginResult not able to load Newtonsoft.Json 10.0.0.0

I am facing a weird kind of situation while trying acheiving LoginAsync using Auth0.OidcclientWpf SDK. I am using below code: private async void PerformAuthenticationAsync() { Auth0Client auth0Client = new Auth0Client(new Auth0ClientOptions() { Domain = "mydomain", ClientId = "clientid" }); var extraParameters = new Dictionary<string, string>(); extraParameters.Add("connection", "connectionParam"); var result = [...] read more
c#
auth0
2votes
1answer

Oracle data access version issue

I am connecting to oracle using ODP.NET. My testing server has two versions of Oracle(v4 and v2) installed. I have a third party application which is connected to one version(v4) and my application is connected to the other(v2). When I run my application using a Visual studio, it works perfectly [...] read more
c#
asp.net
oracle
odp.net
2votes
3answers

Could not load file or assembly 'PayPalCoreSDK'

I have 2 webapp projects that work perfectly with this assembly. I've tried everything, copy the BIN folder, delete, make a rebuild. Search for things in the GAC, remove and add references again, with NUGET without NUGET, copy from the folder of projects that work. My error was that on [...] read more
c#
asp.net
visual-studio-2015
web-applications
.net-assembly
2votes
2answers

Could not load file or assembly 'System.ValueTuple Visual Studio 2017 15.8 node js project

I have installed vs2017 15.8. If I open a console C# app it opens fine. However trying to open node js project throws the following error. Has anyone managed to solve it? > Could not load file or assembly 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located [...] read more
node.js
visual-studio
1vote
1answer

Dependency issue when upgrading my computer to mvc4, and trying to deploy mvc3 applications

I am having a very similar problem to this: https://stackoverflow.com/questions/11023923/how-to-fix-this-mvc-website-error-could-not-load-file-or-assembly-system-web-h same exact error message: Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) I know this problem has to do with the [...] read more
windows
asp.net
asp.net-mvc
azure
1vote
2answers

WAtin :Could not load file or assembly

Am getting this error : "Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db7cfd3acb5ad44e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" I know many people already asked about it, but I've tried all the solutions suggested [...] read more
c#
.net
visual-studio-2010
watin
1vote
1answer

HRESULT: 0x80131040 - Microsoft.WindowsAzure.Storage not found

I am currently getting the following error after trying to add a reference to the Azure libraries providing access to storageaccount functionality. This is the problem I am facing: Could not load file or assembly "Microsoft.WindowsAzure.Storage, Version=9.3.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" or one of its dependencies. The located assembly's manifest definition does [...] read more
c#
asp.net
azure
nuget
1vote
1answer

How to resolve .NET Core reference and NuGet package version conflicts When using Dapper library in Hangfire project?

When using Hangfire library into .net core application, There is a version conflict occured between two different Dapper library. One version is V1.5.0 from Nuget package, and another version is V1.0.0 reference from my local .net core project. There is an error when running program. System.IO.FileLoadException HResult=0x80131040 Message=Could not load [...] read more
.net-core
nuget
dapper
hangfire
1vote
2answers

C# Unity Error: Could not load file or assembly

I found this demo article on Unity. Looks pretty straightforward but I'm getting the following error: > Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, 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) https://www.tutorialsteacher.com/ioc/register-and-resolve-in-unity-container using System; [...] read more
c#
unity-container
1vote
0answers

Upgrade EFCore: Could not load file or assembly System.ValueTuple, Version=0.0.0.0

I'm trying to upgrade EFCore 1.1 to EFCore 2.1 After a long journey of "Could not load assembly" and a bunch of NuGet updates, I'm facing what I think is the last wall before the accomplishment. > Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of [...] read more
c#
ef-core-2.0
valuetuple
1vote
0answers

nuget packages, their dlls and assembly binding errors

Take a package like Microsoft.AspNetCore.Http.Abstractions, it depends on Microsoft.AspNetCore.Http.Features by this line in its nuspec: <dependency id="Microsoft.AspNetCore.Http.Features" version="2.1.1" exclude="Build,Analyzers" /> with the 2.1.1 meaning >= 2.1.1, in nuget parlance. So I take a dependency on Microsoft.AspNetCore.Http.Abstractions, version 2.1.1 exactly in my project. Currently, there is both a version 2.1.1 and [...] read more
nuget
1vote
1answer

Azure webapp 502.5 error, appeared out of nowhere

I'm hosting a website on Azure, and it's been working fine for the past few months. I'm using a devops build/release pipeline for CI, which works great as well. This morning, my website went down with a 502.5 error - Process Failure without any recent changes or commits to the [...] read more
c#
asp.net-mvc
azure
asp.net-core
1vote
0answers

The ResolveComReference task could not be instantiated from Microsoft.Build.Tasks.Core

I'm using MsBuild 15.0 APIs to build our own projects. Because of this version of MsBuild doesn't exist in GAC, I had to use library which is called MSBuildLocator to load assemblies of MsBuild. When I want to build projects with COMReferences I get below error: > The "ResolveComReference" task [...] read more
c#
msbuild
msbuild-task
1vote
1answer

Could not load file or assembly 'System.IO.Pipelines'

I recently upgraded my console app project from framework 4.5.2 to 4.6.1. Everything works correctly in the development environment, but when I deploy the full bin folder to my production environment, I get the following error. > Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.IO.Pipelines, Version=4.6.26919.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' [...] read more
.net
1vote
1answer

Assembly binding error on ASP.NET MVC WebApi application when published to IIS

I've been tasked with maintenance of a ASP.NET MVC 5 WebApi application. Every time I've run this application with IIS Express, it runs OK, but every time I publish it to a IIS site and try to invoke any API method, the following error appears: > Could not load file [...] read more
c#
asp.net-mvc
json.net
unity-container
1vote
2answers

Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

My code works just fine locally but after I published to server I keep getting this error: Could not load file or assembly 'Microsoft.Owin, 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) I don't even [...] read more
c#
.net
asp.net-mvc
owin
1vote
2answers

LiteDB- How to add 2 DLL of LiteDB in two different project but they are referenced by one Main project

I have created 3 projects: 1. V_1_OperationProject: (Class library project)To handle operation on LiteDb version 1 2. V_4_OperationProject : (Class library project)To handle operation on LiteDb version 4 3. MainProject: Gives the calls to methods in V_1_OperationProject and V_4_OperationProject project V_1_OperationProject contains logic to open and inset into DB file [...] read more
c#
dll
litedb
1vote
1answer

Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform. (Exception from HRESULT: 0x80131040)

Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.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) I installed the below dll files for WebApi authentication Microsoft.Owin Microsoft.Owin.Host.SystemWeb Microsoft.Owin.Security.OAuth Microsoft.Owin.Security Microsoft.AspNet.Identity.Owin This error will occur only hosting [...] read more
c#
model-view-controller
1vote
0answers

FileLoadException when try dispose Microsoft.Diagnostics.Tracing.Session.TraceEventSession from WindowsService

My WCF service is hosted in a windows service. Wanted the service class to be created as singletion, hence mentioned the servicebehavior attribute of the WCF service class accordingly. OnStart of the windows service host, I create an instance of this class and later use the same to create my [...] read more
c#
windows-services
.net-4.6.1
fileloadexception
1vote
0answers

Automapper and System.ValueTuple dependency/versioning problem

I have just added Automapper to my asp.net application (.net Framework 4.7), to see hopefully being able to replace some of the tedious manual mapping I always need to do. I am now having a lot of problems with System.ValueTuple versions. I Notice I have a nuget package for System.ValueTuple [...] read more
asp.net
.net
automapper
1vote
1answer

Dependency hell and file not found exception with Newtonsoft.Json

I build server applications using C#, .NETCore 2.0 on CentOS 7.6 using JetBrains Rider IDE (latest version). All my services are built as Docker images. I DONT use json.net in my OWN code (I use ServiceStack.Text) but many libraries use it and are causing a big mess with different versions! [...] read more
c#
json.net
.net-core
rider
easynetq
1vote
1answer

netCore 1.1 incompatibility with .Net Framework 4.6.1 in aspx project

in my company we have a project that was built using .netcore v 1.1. The project contains all the classes used by a web service, also built in v1.1. I am attempting to write a tester for the API in an aspx project and wanted to reference that set of [...] read more
c#
asp.net
.net
dll
.net-core
1vote
1answer

How to identify cause of Assembly issue?

I'm getting an error in a new unfamiliar area to me, SharePoint development. I'm trying to debug my solution via Visual Studio 2012 and I get the following error as recorded in the EventLog: Exception information: > Exception type: FileLoadException Exception message: The located assembly's manifest definition does not match [...] read more
c#
sharepoint-2010
0votes
1answer

BizTalk configuration broken following WCF hotfix installation

I usually post over on StackOverflow, but thought this was probably better suited to ServerFault. Please migrate if I'm wrong! I am developing a WCF service and a BizTalk application on my workstation at the moment. As part of the WCF service, I had to install hotfix 971493 from Microsoft [...] read more
wcf
biztalk-2009
0votes
0answers

Exception while adding migrations: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.1.4.0,

I'm trying to add initial migrations to my project that is using EF Core + PostGRE SQL Driver My project structure looks like: .sln |-- | |-- Context(cslib) |-- Controllers(cslib) |-- AppRunner(console app), Startup |--(...) Where AppRunner has: > PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.2" Context has: > PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.1" Controllers have: [...] read more
c#
asp.net-core
asp.net-core-mvc
entity-framework-core
0votes
1answer

I have added Spire.Doc from NuGet, but now getting run-time error?

i am try to implement Spire.Doc, but getting run-time error: Could not load file or assembly 'Spire.Doc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Stack Trace: [FileLoadException: Could not load file or assembly 'Spire.Doc' or one of [...] read more
spire.doc
0votes
0answers

NServiceBus - Could not load file or assembly '' or one of its dependencies

I am working with an .Net Web App that consumes messages from a NServiceBus (v4.7.0) queue. I am getting the following exception: > 2019-02-20 15:35:13,624 [28] ERROR NServiceBus.Unicast.Transport.TransportReceiver [(null)] - [(null)] - Failed to deserialize message with ID: 0942d9eb-126e-4af6-b860-a9f400a3be82 System.Runtime.Serialization.SerializationException: An error occurred while attempting to extract logical messages from [...] read more
.net
nservicebus4
nservicebus-sagas
0votes
1answer

Does PackageReference and package.lock.json remove the need for Binding Redirects in App.Config

In Nuget we can now use PackageReference format for dependencies and also enable repeatable builds using lock files In my project, I get something along the lines of: > { "version": 1, "dependencies": { ".NETFramework,Version=v4.6.1": { "System.Reactive": { "type": "Direct", "requested": "[4.1.2, )", "resolved": "4.1.2", "contentHash": "QRxhdvoP51UuXZbSzcIiFu3/MCSAlR8rz3G/XMcm3b+a2zOC5ropDVaZrjXAO+7VF04Aqk4MCcLEdhxTfWVlZw==", "dependencies": { "System.Threading.Tasks.Extensions": [...] read more
c#
nuget
assembly-binding-redirect
packagereference
0votes
1answer

Could not load file or assembly - After stopping then starting Azure app service

I am publishing an ASP.NET MVC web application to an Azure app service. It runs find when it is initially published. If I turn off the app service then start it again after a few hours I get this error when I try to open the site in a browser, [...] read more
c#
asp.net
asp.net-mvc
razor
azure-web-sites
0votes
0answers

How to move MVVM items to a DLL

I have a project (C#, Visual Studio 2010, MVVM Light) which required some elements to be extracted to a DLL. In the case of data objects and what not, I was able to do this perfectly fine. The problem arose when I wanted to also put my GenericViewModelBase class into [...] read more
c#
dll
mvvm-light
0votes
1answer

Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies

I am completely new to .net applications. I am currently working on connecting historian 5.5 and thingworx using .net SDKs. The SDKs are already developed by someone else and I'm just creating a service and trying to run the service. The service is created but when I run the console [...] read more
c#
asp.net
.net
thingworx
historian
0votes
0answers

Could not load file or assembly 'PCLAppConfig' in UWP project

I have a Xamarin project with iOS, Android and UWP projects. I have installed the version 1.0.1 from nuGet in all three projects and in .net standard's one. The iOS and Android projects works fine but when I run the UWP project this error is triggered: System.IO.FileLoadException: 'Could not load [...] read more
c#
xamarin
xamarin.forms
uwp
0votes
1answer

What to do when bindingredirect does not work?

I am in a situation reminiscent of "DLL hell". I am using a bunch of nuget packages which might muddle the circumstances, I suppose. The complaint is at runtime that it cannot find System.Net.Http 4.0.0.0 > System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of [...] read more
c#
visual-studio-2015
app-config
0votes
0answers

Function failed when called from other project due to assembly file c#

I have a c# solution with 2 projects. one of them is a server (The server was build using signalR) which activates a Hub. The second is a windows form project which suppose to output a basic window, in the constructor of this window I call the following function (from [...] read more
c#
signalr
0votes
1answer

NET Framework project can't load assembly when referencing .NET Standard project

I have a .NET Framework Web project which references a .NET Standard class library. When running the app I get: "Could not load file or assembly 'System.Net.NameResolution, Version=4.0.0.0" So I added the System.Net.NameResolution 4.3.0 nuget package to both of these projects. I can't use package 4.0.0 as this would be [...] read more
c#
.net-core
.net-standard
0votes
0answers

'Newtonsoft.Json' or one of its dependencies

Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembl's manifest definition does not match the(assembly reference. (Exception from HRESULT: 0x80131040 this error appear when I run application: ERROR [https://i.stack.imgur.com/JUwp2.png] read more
c#
asp.net-mvc
0votes
1answer

Resolving .NET TypeLoadExceptions in Azure App Service

I have an Azure App Service where I published my .NET application (.NET Framework 4.7.2). The application works fine on local Visual Studio IIS Express. When I run it in the App Service I get TypeLoadExceptions. The interesting parts are, for example, these errors: - System.IO.FileLoadException: Could not load file [...] read more
asp.net
.net
azure
assemblies
azure-web-app-service
0votes
1answer

Problem when i try to publish my ASP.NET CORE web app in azure - Could not load file or assembly 'Microsoft.Extensions.Identity.Core

I am new in asp.net core and azure. I have small web app on asp.net core mvc, and I want to publish this project to azure. Locally the project work fine, but when I try to build the project through the console on azure, this error appears - > Unhandled [...] read more
c#
asp.net-mvc
azure
identity
0votes
0answers

System.IO.FileLoadException on System.ServiceModel.Primitives

I am currently working on a Xamarin project, and I required something that Xamarin on it's own doesn't support, so I looked for solutions. After messing around with some NuGets, my project ended up with a bunch of weird and unexplainable compile errors, popping up and disappearing randomly. Eventually I [...] read more
c#
fileloadexception
0votes
1answer

'Oracle.DataAccess, Version=2.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies

I have a web project built in Visual Studio 2012. Its using the Oracle.DataAccess.dll Now the one I see in my solution is 4.121 version. But am receiving this error where the project is looking for 2.122 version. Thanks for your help in advance Below is the stack trace > [...] read more
oracle
visual-studio-2012
x86
64bit
processor
0votes
0answers

asp.net Swashbuckle integration causes "Could not load file or assembly 'System.Web.Http, Version=4.0.0.0"

I wish to add Swagger to my asp.net REST service using Swashbuckle as outlined here. I went through all the steps, and since I am using Owin I have both Swashbuckle and Swashbuckle.Core nugets installed. However, when I run, and navigate to http://localhost/myapp/swagger I get the following error.. Could not [...] read more
c#
asp.net
asp.net-web-api2
swagger
swashbuckle
0votes
1answer

Self-contained Asp.net core (1.0.1) app cannot find RestSharp dll

I have an ASP.Net Core (1.0.1) web app. One of the packages it consumes itself consumes RestSharp. When built, the RestSharp dll is indeed in the app root. But when I deploy and browse to the app, I get the following error: > Application startup exception: System.IO.FileLoadException: Could not load [...] read more
asp.net-core
.net-4.6
0votes
2answers

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0'

I'm receiving the following warning on my ASP.NET Core 2.1 MVC project. > C:\Program Files\dotnet\sdk\2.2.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(153,5): warning NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of 2.1.7. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs It appears to be referencing this line in my .csproj [...] read more
c#
asp.net-mvc
asp.net-core
asp.net-core-2.1
0votes
1answer

"Could not load file or assembly 'Ninject.Web.Common'" error on "new StandardKernal()"

I have a web API asp.net project (.net framework 4.6.1). I imported the Ninject.Web.WebApi.WebHost nuget package, which created a Ninject.Web.Common.cs file in my App_Start folder. When I try running my web app, I get this error: System.IO.FileLoadException: 'Could not load file or assembly 'Ninject.Web.Common, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7' or one of [...] read more
c#
asp.net
ninject
ninject.web.mvc
0votes
0answers

NUnit3 couldn't locate assembly "FSharp.Core 4.4.1.0" - Not used in rest of project

I use NUnit3 to run all of my tests, and NUnit3TestAdapter within Visual Studio 2017. When running tests in a build on TFS i get the error: > System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition [...] read more
.net
tfs
package
nunit-3.0
0votes
0answers

Could not load file or assembly 'SendGrid, Version=9.10.0.0

I am attempting to hookup SendGrid for automated account confirmation and password recovery. I am using ASP.net webform application and c#. I have installed the NuGet SendGrid package. I am attempting to amend the IdentityConfig.cs file. The package builds ok. When I register a new user I get the following [...] read more
asp.net
authentication
passwords
sendgrid
0votes
2answers

How to have main project using NewtonSoft.Json with subproject using Json.Net.Unity3D?

I have the situation where I have a class library being used in a Unity3D project, and which uses Json serialization/deserialization. Since the official NewtonSoft.Json NuGet doesn't work well together with Unity, I am using Json.Net.Unity3D (v. 9.0.0.0), which has worked fine up until now. Now I'm setting up another [...] read more
c#
asp.net
unity3d
json.net
assembly-binding-redirect
0votes
1answer

Manifest definition issue deploying Hangfire .net Core 2.1 MVC app

I'm trying to deploy a Hangfire ASP.net Core 2.1 MVC Hangfire app. It works locally but when I deploy it I get this error: An error occurred while starting the application. FileLoadException: Could not load file or assembly 'Hangfire.SqlServer, Version=1.6.21.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match [...] read more
c#
asp.net-core-mvc
hangfire
0votes
1answer

System.IO.Exception with UWP FulltrustLauncher EXE

System.IO.FileLoadException 0x80131040 C# UWP happens when my .exe is launched using await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Parameters") This is weird because it works normal (NOT UWP), the FullTrustLauncher with DesktopBridge supposedly makes regular .exe's run in UWP but it appears not! System.IO.FileLoadException 0x80131040 C# UWP happens when my .exe is launched using await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Parameters") [...] read more
c#
uwp
0votes
0answers

.net core 2.1 EF Core reverse engineering errors VS 2017

Not having a great time with doing EF Core Reverse Engineering. Latest error > The method or operation is not implemented. Scaffold-DbContext "The method or operation is not implemented" i get the same errors for both of these commands Running this from Package Manager Console within VS 2017: Scaffold-DbContext 'Data [...] read more
entity-framework
asp.net-core
.net-core
ef-code-first
ef-core-2.1
0votes
0answers

ASP.Net Razor App - OAuth somehow got into app, can't get it out

Sounds strange, I know... and I've poured over every post I could find relating to this :( However, my website worked just fine and then all of the sudden it is failing on: > Could not load file or assembly 'DotNetOpenAuth.Core, Version 4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. [...] read more
asp.net
vb.net
visual-studio
razor
0votes
0answers

The site can't load pages with updated Global asax

I changed the Global.asax file to custom routes some pages. But now a problem arised: Could not load file or assembly 'System.Web.Optimization, Version=1.1.0.0 [FileLoadException: Could not load file or assembly 'System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. [...] read more
url-routing
global-asax
0votes
1answer

Wrong assembly version from Owin dependency

I need to switch a specific library that was from version 16.1 before to version 15.0. I did this by removing the higher version and installing the lower version by nuget. When building, the correct dll (15.0) is created in the bin-directory. But I receive the following error when starting [...] read more
c#
visual-studio
dependencies
owin
0votes
2answers

Getting Error as Could not load file or assembly 'Newtonsoft.Json

I installed some frameworks Microsoft.Owin.Host.SystemWeb Microsoft.Owin.Security.OAuth Microsoft.Owin.Cors After adding these, I'm getting the following error: > Could not load file or assembly 'Newtonsoft.Json, Version=10.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) Please guide me as [...] read more
c#
visual-studio-2015
0votes
1answer

Could not load file or assembly Autofac

I have a CLI program that runs different tasks on the database every night. When trying to run the program manually I get the following error message. The code hasn't even hit Program.cs as that would output some messages to the console. > Could not load file or assembly 'Autofac, [...] read more
c#
.net
dependency-injection
autofac
0votes
0answers
0votes
1answer

How to resolve FileLoadException in .netcore

I have an asp.net core app which targets net472. It uses the nuget package for Microsoft.SqlServer.Types which references version 14. However, when I run the app in Visual Studio, or deployed to Azure, this exception is thrown which says that version 10 could not be loaded. What I am trying [...] read more
asp.net-core
asp.net-core-2.1
0votes
1answer

.Net project build successful through VSTS. Deployment on Azure cloud gets failed because of Newtonsoft.json error

I am building a .Net project through VSTS (Azure DevOps) using the Visual Studio build plugin. The build is successful but when I am trying to deploy it shows the below error: > Could not load file or assembly Newtonsoft.json or its dependencies. The located assembly's manifest definiton does not [...] read more
azure-devops
0votes
1answer

How to unit test startup.cs .Net Core

my post is an extension of the post How to Unit Test Startup.cs in .NET Core I tried to unit test the class Startup.ca using this(same code then the previous post): [TestMethod] public void ConfigureServices_RegistersDependenciesCorrectly() { // Arrange // Setting up the stuff required for Configuration.GetConnectionString("DefaultConnection") Mock<IConfigurationSection> configurationSectionStub = new [...] read more
c#
asp.net-mvc
unit-testing
asp.net-core
mocking
0votes
2answers

Could not load file or assembly DevComponents.DotNetBar2

So I got this file which is supposed to convert an access database into SQL (for a specific program called PROFFIX, but that's not so important...). However, if I try to run it, it produces the following error: Fehler beim Starten von PROFFIX dbConvert! (Error running PROFFIX dbConvert) System.IO.FileLoadException: Could [...] read more
dotnetbar
0votes
0answers

Microsoft.AspNet.WebApi.Client references on System.Net.Http.Formatting

I have a .net standard 2.0 library where I'm using Microsoft.AspNet.WebApi.Client verison 5.2.6 which has reference to System.Net.Http.Formatting version 5.2.6. Then from .net 4.6.1 I'm reference to this .net standard 2.0 library and I get run time exception System.IO.FileLoadException: 'Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or [...] read more
.net
nuget
nuget-package
0votes
0answers

Exception from HRESULT: 0x80131040 after upgraded vs2017 to 15.9.2

when i add New Scaffolded Item, show below information > Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) how can i solve it read more
asp.net-core
0votes
0answers

Asp.net i got Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies

I rebuild and publish my solition then i uploaded files to server and attached my database. But i got this error. I cant handle it. Server Error in '/' Application. > Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not [...] read more
asp.net
visual-studio
json.net
0votes
0answers

Xamarin project opens up with error: Could not load file or assembly 'System.Collections.Immutable'

I'm working in a github cloned Xamarin project. When I open up the project it displays the following error: Severity Code Description Project File Line Suppression State Error Could not load file or assembly 'System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not [...] read more
c#
android
xamarin
xamarin.forms
xamarin.android
0votes
1answer

Missing assembly error when converting .pptx file to PDF using Syncfusion

I have the following code for converting a pptx to a pdf: IPresentation presentation = Presentation.Open(filePath); presentation.ChartToImageConverter = new ChartToImageConverter(); pdfDocument = PresentationToPdfConverter.Convert(presentation); presentation.Close(); However, when the code hits the line: > presentation.ChartToImageConverter = new ChartToImageConverter(); it gets the following error: > Could not load file or assembly 'Syncfusion.Compression.Base, Version=16.3460.0.29, [...] read more
c#
syncfusion
0votes
0answers

Using .NET Standard from .NET Framework web application fails with "Could not load file or assembly..."

I am trying to use .NET Standard libraries in .NET Framework ASP.NET web applications, and I frequently encounter errors relating to type loading. I have reproduced the problem as follows: https://github.com/sgarshol/VTSample I have built a bare-bones .NET Standard 2.0 library with a single class: namespace VTLib { public class VTMaker [...] read more
c#
asp.net
.net-standard
.net-framework-version
0votes
0answers

Could not load file or assembly 'EPPlus' in nopcommerce 3.80

I am getting above error in nopcommerce 3.80. full error i.e. : "Could not load file or assembly 'EPPlus, Version=4.0.4.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" I surprise that why this type of error [...] read more
epplus
nopcommerce-3.80
0votes
0answers

Program is referring to a different version of Newtonsoft.JSON although a different version is loaded

I was working on a project to Self host a Web API project. There are two packages 1) Microsoft.AspNet.WebAPi.SelfHost 2) Microsoft.AspNet.WebApi. I had run into a problem where two different versions of NewtonSoft.Json had been installed by the above packages and it showed a compile-time warning as well as a [...] read more
c#
json
asp.net-web-api
dependencies
dependency-management
0votes
1answer

Appropriate content for Myapp..runtimeconfig.json configuration file for a .Net 4.7 app on Azure

I'm new with Azure and a bit confused by a few things. I am unable to have my MVC Core application working properly on it. The app is a MVC .Net Core 2.1 application, targetting .Net 4.7.2 framework (not .Net Core), with a rather complex dependency graph. With local IIS [...] read more
asp.net
.net
azure
asp.net-core-mvc
azure-web-sites
0votes
0answers

Visual studio C# unit test System.Net.Http.Formatting assembly not loaded

I'm trying to write tests for my Web API project. But keep running into a runtime exception when executing anything on my Web API controllers.enter image description here [https://i.stack.imgur.com/m4ZWp.png] My test project builds fine. But when running, Visual studio complains about System.Net.HTTP.Formatting.dll that can't be loaded. I checked the version [...] read more
c#
visual-studio-2017
asp.net-web-api2
0votes
1answer

ExcelDataReader 3.4 - System.IO.FileLoadException

I'm using ExcelDataReader 3.4 and it work fine on my developer PC, but when used on production PC, I've got this error > System.IO.FileLoadException: Could not load file or assembly 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. [...] read more
exceldatareader
fileloadexception
system.io.compression
-2votes
1answer

Using .Net Core dll in standard .net Console app

I have built a class library in VS 2017 using .NET Core 2.1. Now, I want to use that dll in a standard console app built in .NET framework 4.6.2. When I refer to the .NET Core dll in the console app, I am getting this error: > Unhandled Exception: [...] read more
c#
.net
dll
.net-core
-4votes
1answer

How to solve this error - can anyone provide a solution?

> Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) read more
c#
sql
entity-framework

Comments

Leave a comment

(plain text only)

Sources

  1. https://github.com/dotnet/coreclr/blob/v1.1.0/src/inc/corerror.xml
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0