GoDaddy windows主机空间500错误之web.config文件
GoDaddy windows主机空间500错误 之web.config文件
1.没有设置读写权限
参考:GoDaddy空间如何设置读写权限
2.数据库参数等其他代码等出错
这个情况需要用到web.config文件显示详细错误信息,本教程主要讨论这个
3..net程序需要full trust level,GoDaddy不能支持.
这个问题可以参考:GoDaddy主机iis相关设置教程
GoDaddy .net信任等级对asp.net程序的影响说明
4.其它未知错误
联系GoDaddy官方检查:联系GoDaddy客服发ticket教程
下面教程主要介绍如何使用web.config文件显示详细的错误信息,而不是单纯500 error
默认情况下.NET程序出现错误,客户端显示以下错误:
引用:
Server Error in '/mytestapp' 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.
代码1:
(适用于IIS 6)
引用:
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
引用:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
其中的mycustompage.htm是你想设置的错误页面
引用:
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="On"default Redirect="mycustompage.htm"/>
</system.web>
</configuration>
引用:
RemoteOnly:
Only users logged on to the console of the server can view the detailed error messages. Remote users will see the generic error page unless the defaultRedirect is defined, in which case the custom page is displayed.
On: No detailed error messages are shown. The custom error page will be used if it was specified in the defaultRedirect.
Off: Detailed error messages are shown for remote and local users. Use this value to set the value of mode.
附件是打包后的web.config文件,解压后传到空间.