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 !!!
Thanks for sharing.
Thanks mate..
This post really helpful to me..
Thanks a lot.
Wow man, you are simple superb
Seriously you ROCK ! I just lost 3 hours in this problem ! And once again i don’t understand why microsoft did this !
thanks again !
F
This was very helpful. Solved my issues after _hours_
Thanks!
ya, very helpful. I struggled for some time and this gave me correct solution. Thankyou.
Thanks, was really very helpful
I have similar error message but the problem is not the same so please help. I have an existing application using EL v3.1 and I now just downloaded EL v5.0 for a different application. I only installed the strong named version and not the source code version for both 3.1 & 5.0. So I only have the versions in c:\program files\.. and not anything in c:\EntLib…
Problem 1: When I bring up my existing app in VS2010, it automatically reflects references to EL 5.0 version which I don’t intent for it to. So I did a work around by adding project reference paths pointing to the 3.1 version and it builds ok. What’s the proper way to fix this?
Problem 2: When I publish my app using clickonce to a remote server where there’s only version 3.1, the users can’t install my app with an error message saying the application requires v 5.0 in the GAC first. Even though on my local machine, when I build the project, it’s only using v3.1 and my bin folder also has v3.1. I’m not ready to upgrade to v5.0 yet. How do I fix this?
Thanks.
thanx dude
Thanks mate..
It solved my issue
make sure you use ConfigurationSection
Thanks alot……… saved alot of time.
One more point to be noted, if after referencing from Program Files\Enterprise Library\Bin\, still its giving reference error, then first clean your solution and then build it, hope full then it would work fine.
Thanks a lot….its working….
Thanks a lot… It works