C
Chris Fellows
My C# (VS 2005) application has a custom exception which, when examined,
does not show a stack trace either in debug or as an executable. I'm using
the StackTrace class and passing the custom exception to the constructor.
The exception's StackTrace property is also null.
The exception is derived from System.Exception and every class constructor
does use the 'base' keyword to set the inner exception & message. The
constructor does not contain any code within the {} brackets.
Can someone help me out as to what might be wrong?
An example:
try
{
// Do something that throws an exception
}
catch (System.Exception exception)
{
MyCustomException myException = new MyCustomException("Custom
exception", exception)
StackTrace stackTrace = new StackTrace(myException, true);
throw myException;
}
does not show a stack trace either in debug or as an executable. I'm using
the StackTrace class and passing the custom exception to the constructor.
The exception's StackTrace property is also null.
The exception is derived from System.Exception and every class constructor
does use the 'base' keyword to set the inner exception & message. The
constructor does not contain any code within the {} brackets.
Can someone help me out as to what might be wrong?
An example:
try
{
// Do something that throws an exception
}
catch (System.Exception exception)
{
MyCustomException myException = new MyCustomException("Custom
exception", exception)
StackTrace stackTrace = new StackTrace(myException, true);
throw myException;
}