Assemble error when trying to log exception

Topics: Exception Handling Application Block
May 21, 2007 at 7:19 PM
Getting the following error when an exception gets raised and is handled using a policy.

Method 'Assemble' in type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.LoggingExceptionHandlerAssembler' from assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=897748d717685598' does not have an implementation.

The config looks like the following

<add name="Business Block Exception Policy">

<exceptionTypes>

<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="ThrowNewException" name="Exception">

<exceptionHandlers>

<add exceptionMessage="Business Block Exception. Exception Code: {handlingInstanceID} "
wrapExceptionType="Tenaska.Business.Exceptions.TenaskaBusinessException, Tenaska.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=897748d717685598" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WrapHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.0.0.0, Culture=neutral, PublicKeyToken=897748d717685598" name="Wrap Handler" />

<add logCategory="General" eventId="9001" severity="Error" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.0.0.0, Culture=neutral, PublicKeyToken=897748d717685598" priority="0" Type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=897748d717685598" name="Logging Handler" />

</exceptionHandlers>

</add>
May 22, 2007 at 2:35 AM
That is indeed a strange error. My guess is that you haven't referenced all the necessary assemblies in your project.

Make sure you referenced:

Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
Microsoft.Practices.ObjectBuilder.dll

Regards,

Dave

______________________________

David Hayden
Microsoft MVP C#