I don’t understand why my client loves Enterprise Library. He is just mad about it. So people, I was trying to implement Enterprise Library in my application and suddenly I received the following error –
An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.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)
I know, I know, many of us get this type of error ample times for different assemblies and every time when we face it; we don’t have a concrete solution.
Alright so here I am presenting you a concrete solution which is good and fantastic and a real time saver.
To resolve above painful error we need to use – fuslogvw.exe tool – Assembly Binding Log Viewer.
Open Microsoft Visual Studio 2010 Command Prompt and type “fuslogvw” [without quotes]. This will open the fuslogvw tool. However the fuslog tool is not enabled by default. If you click on settings button you will find that, log is disabled by default.
To enable logging we need to add DWORD in registry. Type “regedit” in run window, to open registry editor. Navigate to HKLM\Software\Microsoft\Fusion. Add a two DWORDS namely ForceLog and LogResourcebinds and set their value to 1.
Close fuslogvw window if it is open and reopen it from visual studio command prompt. Ok, now we are here all set to see the error. Run your application again. When I ran my error and error was again received as stated above. Then I clicked on “Refresh” on fuslogvw window. List of all assemblies were listed as shown below –
Similarly fuslogvw.exe can be used for resolving other assembly specific errors. Hope this helps.