I've created a custom publisher (write to file) that extends the
MS .Net Exception Management application block. If I run the assemblies
locally (i.e the client app's bin contains a local copy of the 2
constituient dlls:Management.dll and Interfaces.dll) the Management
dll's code that actually references the .config file settings is able
to locate and use those config settings.  As a result, the application
properly logs exceptions to a file.

However, when I GAC the 2 Exceptions Management assemblies and
reference them from a client containing the .config file/settings it
appears that the required .config settings file cannot be found by
the GAC'd requesting (Management.dll) assembly. Because the Exception
block has a default Event Viewer publish behavior, I get 2 two
entries in the Event Viewer.  One for the application exception and
one for the internal Exception Management error (see below)
Because the .config cannot be found (I believe) it can't be used to direct
the Exception Management block to publish to other destinations/non-
default actions ... such as use a custom publisher.

What's the issue here? Visiblity of the .config to GAC's assemblies? I
can't deploy a config file to the GAC. Permissions to the config?  This
issue seems like it's possibly a design oversight. Is there a work-around
like giving the assembly loader a reference to the client or is there a way
to give the GAC'd dlls a reference to the client's config ... or am I just
doing something wrong.

The error received is listed below. I believe it is telling me that
the .config file classes cannot find the .config file.  Again,
everything works as planned when the assemblies are not GAC'd.

>
> Event Type: Error
> Event Source: ExceptionManagerInternalException
> Event Category: None
> Event ID: 0
> Date: 7/13/2003
> Time: 11:33:56 AM
> User: N/A
> Computer: NEW-DEV-BOX
> Description:
>
> 1) Exception Information
> *********************************************
> Exception Type: System.Configuration.ConfigurationException
> Message: Could not create
> Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectio
> nHandl
> er,Microsoft.ApplicationBlocks.ExceptionManagement
> BareMessage: Could not create
> Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectio
> nHandl
> er,Microsoft.ApplicationBlocks.ExceptionManagement
> Filename: NULL
> Line: 0
> TargetSite: System.Configuration.IConfigurationSectionHandler
> GetFactory(System.String)
> HelpLink: NULL
> Source: System

Reply via email to