EAB ReplaceException MessageResourceName & Type Problems

Topics: Exception Handling Application Block
Dec 1, 2007 at 5:54 PM
I am using the Enterprise Library 3.1 May 2007 release of the Enterprise Library Configuration utility to crease an exception handler rule to replace and exception.
I define the ExceptionMessageResourceName and ExceptionMessageReEsourecType properties. I have no problem with the definition. When I re-open the file a the ReplaceException entries ExceptionMessageResourceName and ExceptionMessageReEsourecType properties are modified in the input process. The ExceptionMessageResourceName property is empty, but it's value is placed into the ExceptionMessageReEsourecType property. Then when saving the specification the ReplaceException entries are incorrect.

Created value:

<exceptionHandling> <exceptionPolicies> <add name="Exception Policy"> <exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception"> <exceptionHandlers> <add exceptionMessage="" exceptionMessageResourceName="RSX" exceptionMessageResourceType="Pinetrail.Example.Infrastructure.Shell.Properties.Resources.RSX,shell" replaceExceptionType="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Replace Handler" /> </exceptionHandlers> </add> </exceptionTypes> </add> </exceptionPolicies>
</exceptionHandling>

Value after edit:

<exceptionHandling> <exceptionPolicies> <add name="here is a change"> <exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="NotifyRethrow" name="Exception">
<exceptionHandlers> <add exceptionMessage="" exceptionMessageResourceType="RSX" replaceExceptionType="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Replace Handler" />
</exceptionHandlers> </add> </exceptionTypes> </add> </exceptionPolicies> </exceptionHandling>

Has anyone else seen this problem? Is there a fix? If not, where do I start looking?

Jim
Dec 4, 2007 at 10:47 AM
This issue is caused by an incorrect implementation of the constructor for the ReplaceHandlerNode and WrapHandlerNode classes.

public ReplaceHandlerNode(ReplaceHandlerData replaceHandlerData)
{
if (null == replaceHandlerData) throw new ArgumentNullException("replaceHandlerData");
Rename(replaceHandlerData.Name);

this.message = replaceHandlerData.ExceptionMessage;
this.typeName = replaceHandlerData.ReplaceExceptionTypeName;
this.messageResourceType = replaceHandlerData.ExceptionMessageResourceType;
this.messageResourceType = replaceHandlerData.ExceptionMessageResourceName;
}

Logging as a work item.

Fernando




JimMe wrote:
I am using the Enterprise Library 3.1 May 2007 release of the Enterprise Library Configuration utility to crease an exception handler rule to replace and exception.
I define the ExceptionMessageResourceName and ExceptionMessageReEsourecType properties. I have no problem with the definition. When I re-open the file a the ReplaceException entries ExceptionMessageResourceName and ExceptionMessageReEsourecType properties are modified in the input process. The ExceptionMessageResourceName property is empty, but it's value is placed into the ExceptionMessageReEsourecType property. Then when saving the specification the ReplaceException entries are incorrect.

Created value:

<exceptionHandling> <exceptionPolicies> <add name="Exception Policy"> <exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception"> <exceptionHandlers> <add exceptionMessage="" exceptionMessageResourceName="RSX" exceptionMessageResourceType="Pinetrail.Example.Infrastructure.Shell.Properties.Resources.RSX,shell" replaceExceptionType="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Replace Handler" /> </exceptionHandlers> </add> </exceptionTypes> </add> </exceptionPolicies>
</exceptionHandling>

Value after edit:

<exceptionHandling> <exceptionPolicies> <add name="here is a change"> <exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="NotifyRethrow" name="Exception">
<exceptionHandlers> <add exceptionMessage="" exceptionMessageResourceType="RSX" replaceExceptionType="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Replace Handler" />
</exceptionHandlers> </add> </exceptionTypes> </add> </exceptionPolicies> </exceptionHandling>

Has anyone else seen this problem? Is there a fix? If not, where do I start looking?

Jim

Dec 4, 2007 at 10:48 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.