2
votes

The Exception is

Exception: Could not load file or assembly 'Autofac, Version=2.5.1.827, 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)

The version of 'Autofac' dll that is added to project is 2.5.1.827.But still getting above error.

4
More info please. What are you trying to do when you get this error?Tad Donaghe
Have you checked if the dll is located in multiple places? For example in the GAC?ChristiaanV

4 Answers

2
votes

Enable Fusion logging to assist in seeing which Assemblies are being loaded. You can find many articles and blogs on doing this:

How to enable assembly bind failure logging (Fusion) in .NET

http://blogs.msdn.com/b/thottams/archive/2007/06/02/debugging-load-problems-using-fusion-log.aspx

0
votes

I ran into the same issue as you. My PC shut down unexpectedly and after rebooting I ran into this error when running my application. I was using using Autofac in a ASP.NET MVC3 application.

I cleared my temporary ASP.NET files (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files) and restart IIS and everything was cool.

0
votes

May be you add Autofac.Contrib assembly that reference to different version of Castle.Core

I faced with this issue when add reference to AutofacContrib.DynamicProxy2, this assembly reference to old version of Castle.Core while I add newest version of Castle.Core.

I solved it by copy code of AutofacContrib.DynamicProxy2 to my solution (just 2 files) and it work perfectly.

0
votes

Sometime,all Dlls are not copied into some specific bin folder.See the warning and add the required Dlls in the specific folder which are described in warnings.