I would try this, which I think keeps the original stack trace.
try
{
}
catch (Exception ex)
{
//publish it to the event log
throw;
}
Or change it to
throw ex;
But there is a subtle difference.
"JJ" <JJ@discussions.microsoft.comwrote in message
news:FC**********************************@microsof t.com...
Should just have to rethrow it.
Try
<code>
Catch Ex as Exception
<code here to log to event log>
Throw Ex
End Try
"Nam" wrote:
>In a C# class of an ASP.NET application, I am logging the exceptions to
the
windows even log. How can I simultaneously propagate the exception on top
and
let the Page that calls that C# class to catch the exception?
After catching the exception, I would redirect a customized message to an
error page.
Thank you in advance.