Asp.net 在IIS 7上浏览新部署的MVC应用程序时出错:未设置Http 500和自定义错误
我的MVC项目根目录中的web.config文件中确实存在自定义错误Asp.net 在IIS 7上浏览新部署的MVC应用程序时出错:未设置Http 500和自定义错误,asp.net,asp.net-mvc,iis,iis-7,web-deployment,Asp.net,Asp.net Mvc,Iis,Iis 7,Web Deployment,我的MVC项目根目录中的web.config文件中确实存在自定义错误 <customErrors mode="On" defaultRedirect="~/Error"> <error statusCode="403" redirect="~/Error/UnauthorizedAccess" /> <error statusCode="404" redirect="~/Error/NotFound" /> </customErrors>
<customErrors mode="On" defaultRedirect="~/Error">
<error statusCode="403" redirect="~/Error/UnauthorizedAccess" />
<error statusCode="404" redirect="~/Error/NotFound" />
</customErrors>
其中
Error
是我的应用程序中处理所有异常的控制器(ErrorController
)。首先,我会尝试设置
,以查看底层错误消息是什么。这可能是某种配置错误
由于正在调用应用程序的错误页,因此错误页本身很可能发生错误。设置
可以让您看到错误是什么。我会尝试设置
来查看基本错误消息是什么。这可能是某种配置错误。你试过了吗?好主意!谢谢。如果它正在进入错误处理程序,那么错误处理页面本身可能会发生异常。谢谢你,rsbarro。你是个明星!成功了!无法加载我的一个依赖项。现在,这是一个新问题,但至少我们领先了一步。非常感谢,一点也不。事实上,我自己也打算这么说。请吧。
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 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>
http://10.1.17.43/MyApp/Error?aspxerrorpath=/MyApp