Hmm, well there is no Procedure property that I can see. Perhaps you're looking
for:
ex.InnerException.TargetSite.Name
The one thing to note about exceptions in ASP.NET is that there are two categories
in essence. There are the ones your code caused and then there are other
ones that are raised by ASP.NET due to configuration errors and compiler
errors and things like that. When you receive the notification in the Application_Error
event in global.asax you usually check for which category the exception is
in. If it's in the first category then the type of exception thrown is the
HttpUnhandledException. If it's the second category then it's some other
excetionon (ConfgurationException for example). So you tend to write your
code like this:
void Application_Error(Object sender, EventArgs e)
{
Exception ex = Context.Error;
if (ex is HttpUnhandledException)
{
ex = Context.Error.InnerException;
}
// now log ex
}
So if you want the name of the method where the exception was raised, go
look for ex.TargetSite.Name. The other two good pieces of info are Source
which is the assembly and StackTarce which is usually crucial when tracking
down the error. If you just call Exception.ToString() you get all of that
info in a nice neat package. That's what the link I posted was trying to
show :S
-Brock
DevelopMentor
http://staff.develop.com/ballen