I have a solution which runs pretty nice on 2 machines, but when I try to deploy same solution on specific machine which runs Windows Server 2012(irrelevant because another two instances also run on Windows Server 2012) it keep me throwing:
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)
I've checked all my dependencies and they seem to be ok, may it be something with ASP.NET on machine?
*All my project use Newtonsoft.Json, Version=9.0.1
Newtonsoft.Json is not part of .Net framework. You need to provide it yourself.
The exception you see means either:
Newtonsoft.json.dll is not part of your deployment and 2 machines where your solution works have this dll somehow installed
You have 2 conflicting versions of this dll and the solution does not know which one to pick.
So first check that this dll is present in your bin folder. If not, put it there.
Related
My application is running fine on local, after i publish to azure web apps it gives me the error
Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
how do I fix this? I do not even have the objectBuilder2, if its something I have to reference where do I get it?Please help
Microsoft.Practices.ObjectBuilder2 is part of Enterprise Library. See here
Do you use this library? If not, try to remove references to it. If you use it, then add appropriate .dll to your installation.
For me Microsoft.Practices.Unity references was broken. I've just removed and added it again and worked. Maybe any refereces to Microsoft.Practices.* that would be broken can show this error.
Place Microsoft.Practices.ObjectBuilder2.dll in bin folder of your web application, this will work.
I am trying to write a 'hello world' application with a dependency to an assembly of a CAD software (SpaceClaim). I add the assembly SpaceClaim.Api.V12.dll to my references and build without problems. When I try to run the application I get the following error:
Unhandled Exception: System.IO.FileLoadException: Could not load file
or assembly 'SpaceClaim.Api.V12, Version=12.1.11373.0,
Culture=neutral, PublicKeyToken=7210645d4d5e3a39' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'SpaceClaim.Api.V12, Version=12.1.11373.0, Culture=neutral,
PublicKeyToken=7210645d4d5e3a39'
---> System.IO.FileLoadException: Could not load file or assembly 'SpaceClaim.Api.V12, Version=12.1.8703.0, Culture=neutral,
PublicKeyToken=7210645d4d5e3a39' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) File name:
'SpaceClaim.Api.V12, Version=12.1.8703.0, Culture=neutral,
PublicKeyToken=7210645d4d5e3a39'
(this error message is also discussed here)
After checking the GAC, I can see that there is an assembly with same strong name with the one I am referencing (Version=12.1.8703.0). However when I open these two with a disassembler (ILSpy), I see that they target different runtimes, the one I am referencing targets .NET 2.0 and the one in the GAC .NET 4.0.
I would like to ignore the one in the GAC and pick from the local directory the one that targets NET 2.0. Apparently, simply copying it into the same folder with the executable is not enough. From what I 've read so far here and here, in order to do this, one needs to 'remove the signing' from the assembly. I don't have much experience with .NET so I am wondering, is this something that I can do with 3rd party assembly and if yes how? Or what other alternatives I have? The two assemblies have the same strong name so putting them both in the GAC is not an option as far as I understand.
I'm getting this issue while running test client
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I found many solutions like adding both versions, or enable logging in registry but nothing worked for me. I'm just stuck over here.
Anyone has any idea regarding this then please help me out. Any kind of help will be appreciated.
I expect you have a reference mismatch between two different assemblies with one expecting version 1.2.10.0 of log4net and another some other version. One version of the log4net assembly is copied to your output directory when your solution is built and then when your program is launched the .exe loader is then complaining because it isn't able to load the version of particular assembly (or .exe) is expecting. Upgrading / downgrading your assemblies to use the same version of log4net should solve the problem.
I've created a web application in C#. It uses version 2.3. of the Azure SDK and when I run the app locally using the Azure Emulator it works okay. When I package and deploy to the Azure cloud I get the following exception when start page is trying to load:
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.2.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've looked in all my config files but none of them reference Microsoft.WindowsAzure.ServiceRuntime version 2.2.0.0. Is there something else I should be looking out for?
One of your dependent DLLs (ie. something you have referenced in your role entry point DLL) is referencing the 2.2 version of the service runtime. If you aren't able to find the dependent DLL then there are a few different ways to troubleshoot this. Intellitrace is the easiest, and direct debugging on the Azure VM is the most powerful. See http://blogs.msdn.com/b/kwill/archive/2013/10/03/troubleshooting-scenario-7-role-recycling.aspx for a walkthrough of both options.
I have a web app which used ReportViewer, from which I am trying to delete ReportViewer and all its dependencies.
As far as I can see, I have deleted everything I need to and all works fine locally. However, when I deploy to our QA server and run the site, I get the following error:
System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies.
The system cannot find the file specified.
I suspect that some other dll in the system depends on the ReportViewer.WebForms.dll, but I cannot work out which one. This dll is not referenced directly from anywhere in the app.
Does anyone know what dlls commonly reference ReportViewer.WebForms.dll?
I think the dll's reside in GAC, causing this error. According to MSDN;
When you run ReportViewer.exe, the following files are installed in
the Global Assembly Cache folder on the deployment computer.
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll
Microsoft.ReportViewer.DataVisualization.dll
Refer http://msdn.microsoft.com/en-us/library/ms251723.aspx for more clarification.