2

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.

Marc B
  • 356,200
  • 43
  • 426
  • 500
superman
  • 377
  • 1
  • 5
  • 12

4 Answers4

2

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

Community
  • 1
  • 1
tcarvin
  • 10,715
  • 3
  • 31
  • 52
0

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.

Brendan Vogt
  • 25,678
  • 37
  • 146
  • 234
0

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.

Ha Doan
  • 611
  • 6
  • 20
0

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.