Error ExceptionHandling.Logging.LoggingExceptionHandler

Topics: Exception Handling Application Block
Jul 24, 2007 at 12:09 AM
The type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' cannot be resolved. Please verify the spelling is correct or that the full type name is provided.

I thank for its great coloboracion , Work in Vista Bus. Vs 2005.
Jul 24, 2007 at 12:32 PM
Hi,

I understand you're getting an exception with this message. You would usually provide a stack trace as well, but in this case it's very likely the "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging" assembly is just not deployed with your application. You can verify this using the fusion log (fuslogvw from the VS cmd).

Make sure the assembly is available. Since this is a provider assembly (i.e. not the main assembly for the block), your application probably doesn't reference it so it doesn't get copied to the output folder of your application and you get this failure when debugging. Not having the reference is OK, but it means that you need to copy the assembly yourself.

Fernando
Aug 5, 2007 at 5:36 PM
Hello,

I got the same error after deploying my WebApp on a windows Server 2003.
I already install EntLib 3.1 on this machine (WS 2003) and all the lib are in bin directory of my web folder.
The Web application was made using Orcas beta 2 and targetting Framework 3.5.

Here is the stack trace :


ArgumentException: The type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' cannot be resolved. Please verify the spelling is correct or that the full type name is provided.
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.AssemblyQualifiedTypeNameConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) +180
System.ComponentModel.TypeConverter.ConvertFrom(Object value) +54
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.NameTypeConfigurationElement.get_Type() +24
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.CustomProviderAssembler`3.Assemble(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +42
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.Create(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +76
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntryCustomFactory.Create(IBuilderContext context, ExceptionTypeData objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +116
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +200
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +70
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +171
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +38
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +88
Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +310
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +71
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies) +75
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IReadWriteLocator locator, String id, IConfigurationSource configurationSource) +143
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase`1.Create(String name) +57
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception exception, String policyName, ExceptionPolicyFactory factory) +33

ExceptionHandlingException: The type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' cannot be resolved. Please verify the spelling is correct or that the full type name is provided.
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception exception, String policyName, ExceptionPolicyFactory factory) +178
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName) +45
OrcasWebSite.MasterPage.Page_Load(Object sender, EventArgs e) +680
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Thanks a lot for your help.

Regards

Jeff
Aug 6, 2007 at 2:49 PM
Hi,

Installing the enteprise library on the server shouldn't be necessary (if what you mean by installing is running the MSI, not installing the services).

Can you please make sure the right version of assembly Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll is installed in your application's bin folder. If it is, then please use the fusion log viewer to determine why the assembly is failing to load.

Regards,
Fernando
Aug 6, 2007 at 3:35 PM
Hello Fernando,

in fact i resolve the problem few minutes ago.
What i do was :

Deleting Entlib dll in the bin directory.
Installating Entlib Msi
Putting installed DLL into the Gac.

It works now, but i really not understand why is was not working with dll into the bin....And yes it's the correct version as i have only 3.1 installed.

Thanks a lot for your time.

Best Regards

Jeff
Aug 6, 2007 at 8:55 PM
thanks, its collaboration was helpful. I am in debt with you. Thank you very much,