custom exception

Topics: Enterprise Library Core, Exception Handling Application Block
Feb 27, 2007 at 8:04 AM
I build custom exception handleing(in web application, i add class library project)., i added custom handler to one of the exception type, and when i try to add the assembly to 'type' in the configuration tool, i get the following error:
there were no types found in the assembly that implement or inherit from the base type Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.IExceptionHandler

one of my classes implement this interface: for example

public class AppMessageExceptionHandler : IExceptionHandler
#region IExceptionHandler Members

Exception IExceptionHandler.HandleException(Exception exception, Guid handlingInstanceId)
string result = this.ShowThreadExceptionDialog(exception);

return exception;

so, why is that?
Feb 27, 2007 at 4:14 PM
I can't really debug it from what you have provided.

However, have you tried the Application Block Software Factory which is specifically designed to help you extend Enterprise Library?

You can create a provider library and then choose to create a new Typed Exception Handler for use with the Exception Handling Application Block.

I recommend going that route as a lot of the code is generated for you to help with run-time and design-time integration with the GUI Configuration Tool and application block.




David Hayden
Microsoft MVP C#
Mar 9, 2007 at 4:52 PM
I've had the same problem. Interestingly enough, I've been able to follow the steps you've described when running the configuration tool in debug from the source without getting the error message. However, if I save the configuration file, close it, and reopen it, the configuration tool is unable to get information about the custom handler, I guess because it can't find the assembly. If you put the custom handler's assembly into the directory containing the rest of the Enterprise Library assemblies (for me, C:\Program Files\Microsoft Enterprise Library January 2006\bin), it should work OK.
Mar 9, 2007 at 9:38 PM
My guess is that the problem is caused by your provider referencing a different version of the core EntLib assemblies to the assemblies that the tool knows about, although it's hard to be sure from this distance :-)