2011-02-18 59 views
8

這裏是我的Web.config文件:Web.config中沒有遠程顯示錯誤甚至的customErrors =「關」(在Ubuntu /單聲道)

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
     <customErrors mode="Off" />  
     <compilation debug="true" strict="false" explicit="true />  
     <pages> 
      <namespaces> 
      <clear /> 
      <add namespace="System" /> 
      <add namespace="System.Collections" /> 
      <add namespace="System.Collections.Generic" /> 
      <add namespace="System.Collections.Specialized" /> 
      <add namespace="System.Configuration" /> 
      <add namespace="System.Text" /> 
      <add namespace="System.Text.RegularExpressions" /> 
      <add namespace="System.Web" /> 
      <add namespace="System.Web.Caching" /> 
      <add namespace="System.Web.SessionState" /> 
      <add namespace="System.Web.Security" /> 
      <add namespace="System.Web.Profile" /> 
      <add namespace="System.Web.UI" /> 
      <add namespace="System.Web.UI.WebControls" /> 
      <add namespace="System.Web.UI.WebControls.WebParts" /> 
      <add namespace="System.Web.UI.HtmlControls" /> 
      </namespaces> 
      <controls> 
      <add src ="~/controls/maleBed.ascx" tagPrefix ="mycontrol" tagName ="male"/> 
      <add src ="~/controls/femaleBed.ascx" tagPrefix ="mycontrol" tagName ="female"/> 
      </controls> 
     </pages> 
    </system.web> 
</configuration> 

即使的customErrors模式設置爲關閉(及其絕對是大寫字母「O」),它仍然向我展示了默認錯誤頁面,告訴我在遠程查看實際錯誤之前設置此屬性。

我沒有machine.config文件,我也在Web.Debug.config和Web.Release.config中設置了這個customErrors mode =「Off」。

任何想法的人?

非常感謝。

編輯 - 什麼它顯示:

Server Error in '/' Application 

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> 
+0

你有沒有想過這個? – Sean 2011-08-22 03:03:02

+0

不...我們必須得到windows專用主機。 – 2011-08-22 08:19:31

回答

5

找不到答案 - 我們必須獲得基於Windows的託管。

3

這些設置看起來是正確的我。

您是否正面看到正確的web.config文件?你是否覆蓋你的頁面指令中的任何這些值?

考慮發佈您的整個web.config(無私信息)。

編輯:此外,當您查看頁面時顯示的是什麼?

+0

這是我的整個web.config文件...:/它看起來對我也是正確的。我會看看,但我不認爲我在任何地方壓倒他們 – 2011-02-18 15:54:21

5

我發現我其實是有更改的web.config文件後,重新啓動Apache ...

6

<compilation debug="true" strict="false" explicit="true /> 

在你的代碼是錯誤的。這裏的修正:(見最後引號)

<compilation debug="true" strict="false" explicit="true" /> 
0

雖然我在最近兩天變得非常沮喪與單聲道,並考慮舉辦,我發現自己越來越窗戶,至少爲了MVC 4網站要獲得詳細的錯誤,您必須在Views中找到並找到Web.config,然後添加所需的指令<customErrors mode="Off"/>

在主目錄中找到的Web.config中添加它並不會改變某件事情。

然後真正的麻煩開始了。

0

我確實有一些問題。我對Linux也很新。在我的情況下,問題是我沒有將所需的權限添加到站點文件夾,結果是Web.config甚至沒有被讀取。

只是爲了調試,你可以嘗試允許所有的完整權限到整個站點文件夾(遞歸)。

不建議

  • 搭配chmod -R烏戈+ RWX/your_site_root雖然去生產這樣的權限。

相關問題