Monday, January 05, 2009

An error occurred creating the configuration section, 'Microsoft.Practices.EnterpriseLibrary,The located assembly's manifest definition does not match the assembly reference

     Today I was exploring Enterprise Library 4.1 and encounter this error. I created a sample application and added reference to few DLL from "EntLib41Src\bin" folder to my application. When I hit F5 to run the application I got following error,

"An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.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)"

      While searching for the reason I found a link here. According to this link assemblies in "EntLib41Src\bin" folders are not strong name assemblies. So when you run the application you will encounter error as shown above. While "Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin" folder contains strong name assemblies. You have to add reference from "Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin" folder in your application.

Happy Programming !!!

6 comments:

Sravan said...

thx buddy..it helped :)

Anonymous said...

I also helped me. I was struggling on it. Thank you!

Unknown said...

Well done, thanks for sharing, helped me out and saved me loads of time searching for a solution.

Anonymous said...

Thanks friend..
Saved a lots of time.

Milind Amin said...

Thanks mate. That is good one.

Unknown said...

Thankz a lot dear... I was helpless with this error today in my office ..... but with your solution I will be able to remove my error tomorrow morning in just 15 mins......Really very helpful to me....thankz again