在我的本地计算机上部署已编译且没有错误的应用程序后,我收到内部服务器 500 错误。部署应用程序的服务器具有很高的安全性,因此我需要为每个目录指定读写访问权限。该应用程序使用 Windows 身份验证和 Web 服务通过代理填充下拉框。我认为连接到 Web 服务可能存在问题,或者文件的读/写安全性存在问题,或者事件目录身份验证存在问题。
我编辑了 web.config,以便它可以使用以下代码显示有关错误原因的更多信息:
<system.web>
<customErrors mode ="Off"></customErrors>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<trace enabled="true" pageOutput="true" />
<authentication mode="Windows"/>
<authorization>
<allow roles="alg\ADMIN_USER" />
<deny users="*" />
</authorization>
<client>
<endpoint address="http://63.236.108.91/aCompService.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IAcompService" contract="aComp_ServiceReference.IAcompService"
name="BasicHttpBinding_IAcompService" />
</client>
我现在收到以下错误:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be
displayed.
我想查看堆栈跟踪以及错误来源。
我应该在 web.config 文件中添加什么内容才能显示完整的堆栈跟踪?
网站从本地运行到部署需要更改哪些内容?
更新 - 部署人员取消了一些安全读/写限制,现在我明白了
Parser Error Message: The connection name 'ApplicationServices' was not found in
the applications configuration or the connection string is empty.
为了消除该错误,我删除了第 72 行声明的 AspNetSqlRoleProvider,但仍然 出现错误。然后我删除了 AspNetWindowsTokenRoleProvider 和所有提供程序信息 并得到以下错误:
Exception message: Default Role Provider could not be found.
我们的托管都是远程完成的,但服务器人员可以远程登录到本地网络服务器。看起来服务器人员没有将文件发布到正确的位置。现在,我收到错误:
There is a problem with the resource you are looking for, and it cannot
be displayed.
关于如何解决这些问题有什么想法吗?
感谢您的浏览!
最佳答案
您在应用程序文件夹层次结构中的其他位置是否有一个 web.config,该配置可能会覆盖您所做的更改?当开发人员将 web.config 复制到一个级别以在进行测试更改时保留它的副本时,我以前见过困惑。
这可能会让人头疼。
关于ASP.NET - 部署问题 - 通过 Web.Config 启用堆栈跟踪/跟踪监听器日志以查找内部服务器 500 错误的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5916978/