2016-11-04 41 views
0

当我调试我的MVC的Web App的错误窗口,而不是打开我的登录页面,并且错误是像Web配置远程仅在MVC

To enable the details of this specific error message to be viewable on the local server machine, 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 "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off". 

    <!-- Web.Config Configuration File --> 

<configuration> 
    <system.web> 
     <customErrors mode="RemoteOnly"/> 
    </system.web> 
</configuration> 

注:当前错误页你通过修改应用程序配置标记的“defaultRedirect”属性指向自定义错误页面URL,可以将视图替换为自定义错误页面。

<!-- Web.Config Configuration File --> 

<configuration> 
    <system.web> 
     <customErrors mode="On" defaultRedirect="mycustompage.htm"/> 
    </system.web> 
</configuration> 

任何人可以帮助我在这里?

+0

的可能的复制[如何设置web.config文件中显示完整的错误消息](http://stackoverflow.com/questions/11665322/how-对设置网络配置文件到演出全错误消息) – s3raph86

回答

0

你这里有一个潜在的问题,需要加以解决之前,你可以得到你的登录页面,但首先你需要或者浏览到您的应用程序,同时登录到Web服务器,或更新您的网站.config文件,使其如下所示:

<configuration> 
    <system.web> 
     <customErrors mode="Off"/> 
    </system.web> 
</configuration> 

一旦完成此操作,您至少应该得到实际的错误消息。另请参阅