a blog for those who code

Wednesday 1 October 2014

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

In this post we will show you how to solve "Could not load file or assembly 'XXXX' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)".

The assembly 'XXXX' could be any assembly. This exception is thrown when your application finds an assembly that does not match what you are looking for. A very common mismatch is version number. For example, if you have added a reference of any dll with version 1.0.0.0 but in your web config it is referencing to different version (say 2.0.0.0), you will get this error.

One thing to note that for simply named assemblies version number is ignored but for strongly named assemblies version number is not ignored.

You will also get this error if you have PublicKeyToken mismatch. To check PublicKeyToken of your referenced assembly, you can run the following command in your Visual Studio Command Prompt (point to dll's folder),


sn -T DLL_Name.dll (This will only work if your assembly is strongly named).

You can either manually update your web.config or you can delete all the assemblies and associated files from the project bin folder and add them again one by one. After Recompiling it will fix your problem.

Please Like and Share the CodingDefined.com Blog, if you find it interesting and helpful.

1 comment: