Throwing exceptions from a custom configuration section handler

  • Thread starter Thread starter Thomas Koch
  • Start date Start date
T

Thomas Koch

Hi there - I have created my own implementation of
System.Configuration.IConfigurationSectionHandler in order to have a special
configuration section in an App.Config file that configures my framework.

When a user makes an invalid configuration in this section I throw a
meaningful exception, explaining what went wrong.

Now I would expect this message to be part of the stacktraces printed from
the application, but apparently it eats my exception and simply states that
something went wrong during the reading of my configuration section.

Does anyone know how to make .NET print all the stack traces?

Regards
Thomas Koch
 
Thomas,

Unfortunately, there is no hook into that kind of functionality. I
think that the class is trying to be smart.

However, did you check the InnerException property on the exception? It
is possible that your exeption would be in there somewhere, and that the
exception thrown is what is thrown when any exception occurs.

Hope this helps.
 
Back
Top