Asp.net - 尝试访问工作网页时出错 [英] Asp.net - error when trying to access working webpage

查看:71
本文介绍了Asp.net - 尝试访问工作网页时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我创建了一个asp.net网页并将其上传到网络服务器上。但是,当我尝试远程查看页面时,我收到有关web.config文件中的customerror标记的错误。该页面在本地工作,没有错误或警告。此外,如果我将页面上传为.html或.asp文件,我可以远程查看它。我看到很多其他人都有这个错误,但是'解决方案'只是说将customErrors标签更改为'Off',我已经完成并且不起作用,你知道网络服务器是否有问题或者是什么可能是这里的问题?



这是错误页面:

Dear Friends,

I have created an asp.net webpage and have uploaded it onto a webserver. However when I try to view the page remotely, I get errors about the customerror tag in the web.config file. The page works locally with no errors or warnings. Also if I upload the page as a .html or .asp file, I can view it fine remotely. I have seen a lot of other people with this error, but the 'solutions' just say to change the customErrors tag to 'Off', which I have done and does not work, do you know is there an issue with the webserver or what could be the problem here?

Here is the error page:

Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>





请指导我。



Kindly guide me.

推荐答案

为什么不检查错误日志(服务器或邮件日志中的文件日志)?你在维护任何日志吗?使用log4net或nlog等组件来实现错误记录。并设置 customErrors mode =On&再试一次。
Why don't you check the error log(file log in server or mail log)? Are you maintaining any logs? Use components like log4net or nlog to implement the error logging. And set customErrors mode="On" & try again.


这篇关于Asp.net - 尝试访问工作网页时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆