ELMAH does not display the source page of an ASP.NET error in MVC3

http://www.matheda.com/Blog/Details/3/Exception-Logging-with-ELMAH

Using the above URL as a link, I see that ELMAH should display the page of the ASP.NET source page when an error occurs from the view.

I created the following view to generate an error, but the only exceptions are Raw / Source data in XML or in JSON.

@{ ViewBag.Title = "ViewError"; } <h2>View Error</h2> @{ throw new NullReferenceException(); } 

Can I view the source page of ASP.NET errors in MVC3?

+4
source share
2 answers

MVC3 now has a different error handling process that bypasses HttpApplication error handling, and I'm not sure ELMAH can recreate the yellow screen of death at this point.

CodeSmith Insight has very similar functionality with ELMAH, and we had to create a new MVC3-specific HttpModule in order to continue to receive all the exception data. Here is a post on our implementation , hope this helps.

+7
source

If I return correctly, ELMAH will raise Server.GetLastError () , which means that if an error occurs after the error you expect, you can get an ELMAH report that is different from your expectations.

I know that this happened to me when my 404 page was not really there ... I received spam due to errors detected by the page when there was another error at all.

+1
source

Source: https://habr.com/ru/post/1338484/


All Articles