开发者

How to see errors in an asp.net website?

I just want to see error insteas of asp.net showing me default error Server Error in '/' Application. What should i change in web config?

I used this,

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error st开发者_运维问答atusCode="404" redirect="FileNotFound.htm" />
        </customErrors>

Any suggestion i want to see errors in browser as i do live testing...


Change this:

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

To this:

<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">

RemoteOnly means you'll see the errors if you're logged onto the web server itself (e.g. http://localhost/) Off means to display the errors to everyone, including remote clients.


An alternative is to browse to your site using it's localhost url. This will allow you to see the errors, but with the customErrors = "RemoteOnly", users browsing to the site using a non-localhost url will see the friendly error page. Also check the server's eventlog, if you're not confident that you are seeing the full error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜