我和朋友在Asp.Net中实现了一个应用程序,我有一个奇怪的问题
我从ftp服务器下载了最新的源代码(我们还没有安装源代码控制工具),当我尝试编译并运行应用程序时,IIS抛出异常。我检查了目录,并且有一个web.config文件
我不明白有什么不对:(。感谢您的帮助:)。
这就是IIS的回应:
Runtime Error
Description: An application error occurred on the server. The current custom error
settings forthis 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 <customErrors> tag within a "web.config"
configuration file located in the root directory of the current web
application. This <customErrors> tag should then have its "mode"
attribute set to "Off".
<!-- Web.Config Configuration File -->
<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 <customErrors>
configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
答案 0 :(得分:4)
哦,天啊!我找到了问题。我还没有在Windows资源管理器选项中查看&#39;显示所有已知的文件扩展名&#39;我用txt扩展保存了web.config,但我还没有看到那个荒谬的错误。谢谢你的帮助!!!
答案 1 :(得分:2)
您需要将该部分添加到Web.config中,以便查看实际的异常。
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
答案 2 :(得分:1)
不将其更改为<customErrors mode="Off"/>
,您无法看到实际错误。
所以把它改成
<system.web>
<customErrors mode="Off"/>
</system.web>
看看你得到的实际错误。