I have a VS 2008 solution whose projects are making use of a number of the Microsoft.Practicies libraries.
**Versions for all of the assemblies are: 4.1.x
Everything builds fine, but when I run it, I get the following runtime error:
Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.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)
There are no versions of the enterprise library installed on the machine where the building and running is taking place.
"Copy Local" is true, and "Specific Version" is false for all assemblies.
What am I doing wrong here?
Related: Could not load file or assembly, Force Visual Studio References
The Microsoft practices libraries are tightly coupled, and some of the assemblies are interdependant. Make sure that you have added all the libraries you need, plus any additional library dependencies
Related
I'm getting the following exception when the json.net dll 9.0.1 is going to be loaded in my Windows Phone 10 (App compiled in ARM architecture), in the emulator it loads fine.
"Could not load file or assembly 'Newtonsoft.Json, Version=9.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)"
I tried adding the dll manually but it has the same problem.
I ended up downgrading to version 8.0.3 which works perfectly.
I moved my existing ASP .NET web sites and web applications to a new server, and I'm getting the following error:
Could not load file or assembly 'System.Web.WebPages.Deployment,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
I located this assembly on my computer, and copied it to the BIN folder of my web site. It gives a new error:
Could not load file or assembly 'System.Web.WebPages.Deployment,
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)
Does this mean ASP .NET is not properly installed on the server machine? How do I go about fixing this? I also noticed that the assembly is present on my computer somewhere in the Program Files (x86)/Microsoft ASP.NET folder. However, the Program Files (x86)/Microsoft ASP.NET folder does not exist on the server.
Solution: I installed both ASP .NET Web Pages and ASP.NET MVC 4 on the server. This installed the missing assemblies and created the folders that were missing.
The exceptions speak for themselves: Your project has referenced version 2.0.0.0 of this assembly and you have copied version 1.0.0.0
Find the correct version and you'll be OK
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 its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
How can I fix this problem?
Delete all Autofac references in your project and add them again, using the correct Autofac DLL. The mismatch occurs when the reference you've added to your project via the Add Reference menu is not the same version as the actual file. This happens when you exchange the physical DLL file on your disk to which the reference in your project points.
Up until yesterday we only saw this error once before when the site first went live but now it has happened two days consecutively.
This is the error:
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)
So far, what seems to work is toggling the ClassLibrary > References > Newtonsoft.Json > "Copy Local" property (between True and False), then pushing the appropriate .dll's up.
Does anyone know why this references randomly becomes inaccessible?
I'm a .Net and NopCommerce noob so any advice or articles that would shed some light or point me in the right direction would be very helpful.
I am having a problem where an older GAC'd assembly is being used instead of a newer version assembly in the bin.
Server:
Assembly version: ASP.NET MVC 3 RC 1 (3.0.11029.0)
Full name: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
Development machine:
Assembly version: Unknown version (3.0.20105.0)
Full name: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
The newer RTM version (3.0.20105.0) is in the bin directory of the application. However, the application is using the one in the GAC instead of the local bin. My experience from windows applications is the local bin deployed DLL always takes precedence because the GAC is checked only if the DLL isn't found in the same directory as the application. This convention appears to not be the case for a web application.
How can I force it to use my newer version bin deployed DLL (3.0.20105.0)?
Edit:
I actually did try a binding redirect like so:
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="3.0.11029.0" newVersion="3.0.20105.0" />
I tried several variations on the oldversion such as 0.0.0.0-4.0.0.0. In all my attempts usually it either loaded the older version, or gave me this exception message:
Could not load file or assembly 'System.Web.Mvc' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.
The binding log didn't have any errors except this was last two lines:
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Answered is SO Dll in both the bin and the gac, which one gets used? Note, you must run strong name hijack or it will use the GAC version.
I would retag this, it is not MVC specific.
You can modify your .config files to use assembly binding redirection for this and force the runtime to load different versions as you require.