Bro*_*nek 52
要检查导致ASP MVC下的内部服务器500错误的原因,您还可以在调试模式下运行应用程序并检查属性AllErrors.
该属性是Exception类型元素的数组.
要做到这一点,打开Global.asax.cs(C#)并在类的MvcApplicationput方法体中Application_EndRequest:
protected void Application_EndRequest()
{ //here breakpoint
// under debug mode you can find the exceptions at code: this.Context.AllErrors
}
Run Code Online (Sandbox Code Playgroud)
然后设置断点并检查数组的内容: this.Context.AllErrors
它帮助我解决了抛出的异常,并可选择查看堆栈跟踪.
500服务器错误表示脚本已引发错误,这不是链接断开(也称为404错误)。
如果您使用的是Internet Explorer,请转到tools > options > advanced并取消选择friendly http errors,这将为您提供对该错误的更全面的描述,以便您可以调试脚本或联系相关人员进行调试。
我从 Windows 事件查看器(运行>eventvwr.msc>Windows 日志>应用程序)获得了有关错误的更多详细信息。检查 w3wp.exe 记录的警告/错误
就我而言,原因是缺少 dll。希望这可以帮助
| 归档时间: |
|
| 查看次数: |
65708 次 |
| 最近记录: |