When debugging my MVC 4 application in VS2010 SP1, the Application_Error() handler was Server.GetLastError() , but Server.GetLastError() was empty.
protected void Application_Error() { var exception = Server.GetLastError();
MSDN Status Application_Error is
thrown if an unhandled exception occurs anywhere in your application ... You can get information about the most recent error from the GetLastError method.
MSDN Server.GetLastError for Server.GetLastError () states
Return value: previous exception that was thrown.
How can I be in the state where Application_Error() was called, but Server.GetLastError() returns null?
source share