Get Class Name and Method Name Where Exception Occurred From Exception Details

desi

New Member
I have this Application_Error event in my Global.asax.cs which will get any unhandled exceptions occurred in my application. I was able to get the error message. What I'm trying to get also is the Class name and Method name where exception happened so that it,s easier to trace where and what is the cause of the exception. Please help.Global.asax.cs\[code\]protected void Application_Error(object sender, EventArgs e) { var errMsg = Server.GetLastError().Message; if (string.IsNullOrWhiteSpace(errMsg)) return; //Get Class name and method name //ErrorLog.SaveLog(errMsg, Classname, Methodname); Context.ClearError(); }\[/code\]
 
Back
Top