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=188.8.131.52, 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 !!!