简体   繁体   English

如何在托管网站时解决asp.net中的运行时错误

[英]how to resolve runtime error in asp.net while hosting website

i done my work on local. 我在本地完成了工作。 All pages of aspx is working properly but when i upload my website to remote server. aspx的所有页面均正常运行,但是当我将网站上传到远程服务器时。 i face this error .... 我面对这个错误....

Runtime Error Description: Failure of an application on the server. 运行时错误说明:服务器上的应用程序失败。 For security reasons, the current custom settings to prevent application failures remotely view more details about the error encountered. 出于安全原因,防止应用程序故障的当前自定义设置可远程查看有关遇到的错误的更多详细信息。 These details can be displayed in the browser but run locally on the server. 这些详细信息可以显示在浏览器中,但可以在服务器上本地运行。

Details: To enable the display of the details of this specific error message on the remote server, create a tag in a configuration file "web.config" in the root directory of the current web. 详细信息:要在远程服务器上显示此特定错误消息的详细信息,请在当前Web根目录的配置文件“ web.config”中创建一个标记。 The "mode" attribute of the tag must be set to "Off". 标签的“模式”属性必须设置为“关”。

<! - Web.Config Configuration File -> 
<configuration> 
    <system.web> 
        <customErrors mode="Off"/> 
    </ system.web> 
</ configuration>

Note: You can customize the error page by modifying the current attribute "defaultRedirect" application configuration tag to point to the URL of a custom error page. 注意:您可以通过修改当前属性“ defaultRedirect”应用程序配置标记以指向自定义错误页面的URL来自定义错误页面。

Please tell me how can i remove this error and see my asp pages on internet browser. 请告诉我如何删除此错误,并在Internet浏览器上查看我的ASP页面。

You are getting some error that is not shown to you. 您收到一些未显示的错误。 You have to turn the customErrors mode to off or set RemoteOnly to see the error, you might be getting exception while accessing database. 你要打开的customErrors模式, off或设置RemoteOnly看,你可能会得到错误exception ,同时访问数据库。 Once you know the error you can fix that error and set the mode to On again in customErrors tag in web.config . 知道错误后,您可以修复该错误,然后在web.config的 customErrors标记中再次将模式设置为On

<customErrors defaultRedirect="url" mode="Off">
      <error statusCode="500" redirect="InternalError.htm"/>
</customErrors>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM