Web.config Custom Errors mode Conflict

前端 未结 11 1417
执笔经年
执笔经年 2020-12-25 12:52

I have a great and important problem with Web.Config, I need to see the Error of my page and resolve it in asp.net web form and web config, but when Error Occurred, I see an

相关标签:
11条回答
  • 2020-12-25 13:42

    Make sure you nest the customErrors tag somewhere inside your <system.web> tag like this:

    <system.web>
    <customErrors mode="Off" />
    </system.web>
    

    From your description it's already likely it was placed there by you or automatically generated another way. Also try setting to On and restart the Application pool. You can do this by simply modifying web.config file by adding a break return or even just hit the space key, as long as you've made a change. Now re-upload making sure this is your second time with the customErrors mode was set to On. Hopefully you can now view your custom error page.

    If you are still having problems, and have access to your web site from IIS Manager try editing the .NET Error Pages in Features view. That will also do the same thing, providing your custom error page is in the correct directory for the web.config file to access.

    0 讨论(0)
  • 2020-12-25 13:46

    Many hosting companies actually override the settings from your web.config file by theirs. You can usually set these concrete attributes in the web host's dashboard for the website.

    If you tell us the concrete web hosting you are using, we should be able to assist better with concrete steps.

    0 讨论(0)
  • 2020-12-25 13:48

    To show the error for debugging and NOT showing an custom error page you do not need a defaultRedirect and simply having this should then output the debug / exception information:

    <system.web>
        <customErrors mode="On" />
    </system.web>
    

    NOTE: Ensure that On starts with an upper-case O. By changing the web.config this should (by default) recycle your app pool and be picked up straight away.

    0 讨论(0)
  • 2020-12-25 13:50

    When you're having issues with configuration, make sure that your settings isn't overridden.

    In this case, your server might have a configuration <deployment retail="true" /> that overrides application settings and disables trace output, custom errors, and debug capabilities.

    Change the value to "false"

    <deployment retail="false" />
    

    MSDN Link

    0 讨论(0)
  • 2020-12-25 13:50

    First, you can set CustomErrors mode from "RemoteOnly" to "off" <customErrors mode="Off"></customErrors>

    Second, You can check the global.asax.maybe you create Response.Redirect as same as defaultRedirect in customError. you can check more detail in here ASP.NET customErrors with mode=remoteOnly and global.asax handling exceptions

    and the last,maybe you create two system.web in your webconfig. You should only have one in your config file.please check again your webconfig. and dont forget <compilation debug="true"/>

    0 讨论(0)
提交回复
热议问题