.Aspx error - how to disable?

I have Error.aspx loaded by server error, but the problem is that it does not have information about it, and I can’t determine how and why it loads. I searched my project for "Error.aspx" and nothing came of it. How do you get a stack trace or something half useful?

thanks

+4
source share
2 answers

Do you use the HandleError attribute on any of your controllers? If this attribute is present when an unhandled exception occurs, ASP.NET MVC will look for a view named Error.aspx in the controller view folder. If he does not find it, he will look in the shared folders. If you have standard controllers in your project (for example, HomeController, AccountController), you will notice that they have an attribute.

+2
source

Look in the web.config file for the <customErrors> element.

It probably indicates defaultRedirect="Error.aspx" and mode="On" . Set mode="Off" or create an error page.

Read the MSDN docs : customErrors Element (ASP.NET Settings Diagram)

Note. It is also possible that the <customErrors> element is inherited from the .config file above at the global server level (one of the root.config or machine.config files). Check them out if you cannot find <customErrors> in your web.config application file.

+2
source

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


All Articles