I'm using the Enterprise Library Exception handling block in an ASP.NET web application. I was just using this app yesterday at work (non-VPN) and everything worked fine. I'm working at home today and as soon as I have forms auth'd into the app, I get this 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) (C:\Projects\ThesaurusSME\ThesaurusSME\web.config line 5)
This error hits in c:\EntLib41Src\Blocks\Common\Src\Configuration\SystemConfigurationSourceImplementation.cs, at this method:
public override ConfigurationSection GetSection(string sectionName)
{
ConfigurationSection configurationSection = ConfigurationManager.GetSection(sectionName) as ConfigurationSection;
SetConfigurationWatchers(sectionName, configurationSection);
return configurationSection;
}
I have checked all the files in the bin folder and all are 4.1.0.0.
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
All of the other sections of web.config that reference these sections are also showing 4.1.0.0.
If it helps, the InnerException/FusionLog says:
"=== Pre-bind state information ===
DisplayName =
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,
Version=4.1.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35\n
(Fully-specified) LOG: Appbase =
file:///C:/Projects/ThesaurusSME/ThesaurusSME/
LOG: Initial PrivatePath =
C:\Projects\ThesaurusSME\ThesaurusSME\bin
Calling assembly : (Unknown).
=== LOG: This bind starts in default load context. LOG: Using application
configuration file:
C:\Projects\ThesaurusSME\ThesaurusSME\web.config
LOG: Using machine configuration file
from
C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference:
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,
Version=4.1.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35\r\nLOG:
Attempting download of new URL
file:///C:/Users/heckacr1/AppData/Local/Temp/Temporary
ASP.NET
Files/root/ac718580/56b7f71/Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL.
LOG: Attempting download of new URL
file:///C:/Users/heckacr1/AppData/Local/Temp/Temporary
ASP.NET
Files/root/ac718580/56b7f71/Microsoft.Practices.EnterpriseLibrary.ExceptionHandling/Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL.
LOG: Attempting download of new URL
file:///C:/Projects/ThesaurusSME/ThesaurusSME/bin/Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY
TOKEN ERR: Failed to complete setup of
assembly (hr = 0x80131040). Probing
terminated."
Why would this only happen when I'm away from the wired intranet and VPNing in?
Best Answer
You probably still aren't having this trouble, but I found the solution here: http://chiragrdarji.wordpress.com/2009/01/05/an-error-occurred-creating-the-configuration-section-microsoftpracticesenterpriselibrarythe-located-assemblys-manifest-definition-does-not-match-the-assembly-reference/