I get this error below when I add the Enterprise library 5.0 MS.Practices.EnterpriseLibrary.ExceptionHandling.dll file for my wcf application.
An error occurred creating the configuration section handler for the Handling exception: the file or assembly "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = null" or one of its dependencies could not be loaded. The located assembly manifest definition does not match the assembly reference.
<exceptionHandling> <exceptionPolicies> <add name="Global Policy"> <exceptionTypes> <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None"> <exceptionHandlers> <add name="Wrap Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WrapHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling" exceptionMessage="Global Message." wrapExceptionType="ExceptionHandlingQuickStart.BusinessLayer.BusinessLayerException, ExceptionHandlingQuickStart.BusinessLayer" /> <add name="Custom Handler" type="AppMessageExceptionHandler, ExceptionLibraryForWCF"/> </exceptionHandlers> </add> </exceptionTypes> </add> <add name="Handle and Resume Policy"> <exceptionTypes> <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None"> <exceptionHandlers/> </add> </exceptionTypes> </add> <add name="Propagate Policy"> <exceptionTypes> <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow"> <exceptionHandlers/> </add> </exceptionTypes> </add> <add name="Replace Policy"> <exceptionTypes> <add name="SecurityException" type="System.Security.SecurityException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="ThrowNewException"> <exceptionHandlers> <add name="Replace Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" exceptionMessage="Replaced Exception: User is not authorized to peform the requested action." replaceExceptionType="System.ApplicationException, mscorlib"/> </exceptionHandlers> </add> </exceptionTypes> </add> <add name="Wrap Policy"> <exceptionTypes> <add name="DBConcurrencyException" type="System.Data.DBConcurrencyException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="ThrowNewException"> <exceptionHandlers> </exceptionHandlers> </add> </exceptionTypes> </add> </exceptionPolicies>
Below is my web.config declaration for my exception handling ->
source share