2016-11-04 46 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> 

一旦完成此操作,您至少應該得到實際的錯誤消息。另請參閱