Show specific error in ASP.NET MVC

Asked

Viewed 680 times

2

I created a site that works normally, however, when uploading it to the hosting server, it shows an error:

Server Error in Application '/'.

Since the error is too generic, he says to include the line <customErrors mode="Off"/> in my file web.config. I did that, but the error returned is?

An error occurred while Processing your request.

That is, none of the mistakes help much.

I want to know how to see a more specific error message to facilitate correction.

In my case, the error occurs when I try to create a file txt and download (must be permission error). How can I know if it is right and fix?

  • 1

    Probably the code is preventing the error from showing. People think that catching an exception is a good thing, but it’s usually the one that causes the most trouble. See also if you’re setting it right: https://stackoverflow.com/a/4364032/221800

  • I made the configuration that passed the link and gave error: 500 - Internal server error.

  • Now appeared: Non-static method requires a destination.

1 answer

2


Probably the mistake was that there was more than one <system.web>, can only have one, or the error setting was not within this section. It might be interesting to turn on debug mode as well.

<system.web>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
</system.web>

I put in the Github for future reference.

Also make sure that there is no exception catch that prevents the error from being shown.

  • I saw the error, I’ll create another question to try to solve it

Browser other questions tagged

You are not signed in. Login or sign up in order to post.