Exception Handler ExceptionPolicy.HandleException error

Topics: Exception Handling Application Block
Jul 9, 2007 at 11:47 PM

has anyone seen or know of a solution to the below error i am getting when i call ExceptionPolicy.HandleException???

Line 126: bool rethrow = ExceptionPolicy.HandleException(Server.GetLastError(), "Page Level Policy");
Line 127: if (rethrow){ throw(Server.GetLastError()); };


The Assembler attribute is not set in the configuration object type Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlerData.

Server Error in '/DevelopmentWebsite' Application.
--------------------------------------------------------------------------------

The Assembler attribute is not set in the configuration object type Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlerData.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The Assembler attribute is not set in the configuration object type Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlerData.

Stack Trace:


InvalidOperationException: The [Assembler] attribute is not set in the configuration object type Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlerData.
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.GetAssemblerAttribute(Type type) +197
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.GetAssembler(TConfiguration objectConfiguration) +271
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.Create(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +45
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntryCustomFactory.Create(IBuilderContext context, ExceptionTypeData objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +162
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +191
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +134
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +184
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63

Jul 10, 2007 at 7:38 PM
Hi,

What does your configuration file look like? Are you using a custom exception handler? Looks like your configuration is not being properly deserialized (one configuration object is being deserialized as an instance of the base ExceptionHandlerData class instead of one of the concrete subclasses).

Fernando
Jul 10, 2007 at 9:42 PM
Fernado thanks very much for responding i really appreciate it.

I figure the problem out. The error(s) i was getting was due to the fact that i am using the Exception Handlers for the Web Client Software Factory and I had Application Blocks configured for Modules and Web site. The WCSF has several web.config files and this was causing the issue. I setup the ExceptionHandler in one place and that solved my problem.

thanks again tom


Nov 15, 2007 at 12:02 PM
Hi Tom,

I'm having the same problem as you. I've set up my WCSF Application inside the Default Website and I only have the LoggingSettings and ExceptionHandlingSettings in the root application web.config (I've also tried moving it to the Default Website web.config) and nothing on any of the modules' web.config. Whatever I do I always get the same exception you had, I've even isolated my app in its own website to no avail
Can you explain a little more what you did to make it work please? Thank you.

Carlos Alfaro
Dec 13, 2007 at 1:35 PM
Hi Tom,

I'm having the same problem as you. I've set up my WCSF Application inside the Default Website and I only have the LoggingSettings and ExceptionHandlingSettings in the root application web.config (I've also tried moving it to the Default Website web.config) and nothing on any of the modules' web.config. Whatever I do I always get the same exception you had, I've even isolated my app in its own website to no avail
Can you explain a little more what you did to make it work please? Thank you.

Carlos Alfaro