var actionMethod = new StackTrace(exception)
.GetFrames().FirstOrDefault(f =>
typeof(IController).IsAssignableFrom(f.GetMethod().DeclaringType)
).GetMethod();
Add the following method in your global.asax and put a break point on it
public void Application_Error(object sender, EventArgs e)
{
}
No matter where in the application an error occurs, the break point on this method will be hit. From here you can see the value for the following expression in the quick watch window and you will know what exactly was the cause of the exception that occurred
As Charlino implied, the values are available from the ExceptionContext parameter:
Check the exception's call stack.
For example:
Add the following method in your global.asax and put a break point on it
No matter where in the application an error occurs, the break point on this method will be hit. From here you can see the value for the following expression in the quick watch window and you will know what exactly was the cause of the exception that occurred
This method will help, no matter where the exception occurs in your web application.