2013-06-19 31 views
0

我試圖在我們的大學服務器上部署Web應用程序,但我在運行該頁面時得到的所有內容是「500-內部服務器錯誤」 (您正在查找的資源存在問題,並且無法顯示。)服務器上的Web應用程序不會顯示錯誤(只有內部服務器錯誤)

上次我記得在web配置中添加了一些內容,但似乎無法記住它是什麼。我試着補充說:

<customErrors mode="Off"> 
    </customErrors> 

但它似乎並沒有解決它。

我應該添加到我的網絡配置,以顯示錯誤的權利?所以我會知道什麼是錯的。

這是我的web配置:

<?xml version="1.0"?> 
<!-- 
    For more information on how to configure your ASP.NET application, please visit 
    http://go.microsoft.com/fwlink/?LinkId=169433 
    --> 
<configuration> 

    <!--show errors on server--> 
    <customErrors mode="Off"> 
    </customErrors> 

    <!--connection string--> 
    <connectionStrings> 
      <add name="igroup20_test2ConnectionString" connectionString="Data Source=Media.ruppin.ac.il;Initial Catalog=igroup20_test2;User ID=igroup20;Password=****" providerName="System.Data.SqlClient"/> 
    </connectionStrings> 

    <system.web> 

    <!--define membership--> 
    <membership defaultProvider="CustomizedProvider"> 
     <providers> 
     <add name="CustomizedProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="igroup20_test2ConnectionString" applicationName="ScottsProject" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"/> 
     </providers> 
    </membership> 

    <!--define roles--> 
     <roleManager enabled="true" defaultProvider="CustomizedRoleProvider"> 
      <providers> 
       <add name="CustomizedRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="igroup20_test2ConnectionString" applicationName="/"/> 
      </providers> 
     </roleManager> 

    <!--define profile properites--> 
    <profile defaultProvider="CustomProfileProvider" enabled="true"> 
     <providers> 
     <add name="CustomProfileProvider" 
      type="System.Web.Profile.SqlProfileProvider" 
      connectionStringName="igroup20_test2ConnectionString" 
      applicationName="ScottsProject" /> 
     </providers> 

     <!-- Define the properties for Profile... --> 
     <properties> 
     <add name="prof" type="String" serializeAs="String" /> 
     </properties> 
    </profile> 


     <authentication mode="Forms"/> 

     <compilation debug="true" targetFramework="4.0"> 
     <!--<httpRuntime targetFramework="4.5"/>--> 
      <assemblies> 
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     </assemblies> 
    </compilation> 

    <!--handler for the ajaxupload control--> 
    <httpHandlers> 
     <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" /> 
    </httpHandlers> 


    </system.web> 

    <!--handler for the ajaxupload control--> 
    <system.webServer> 
    <handlers> 
     <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" /> 
    </handlers> 

    </system.webServer> 

</configuration> 

編輯

我說:

<system.web> 
    <customErrors mode="Off"/> 
     <compilation debug="true"/> 
    </system.web> 

和:

<system.webServer> 
    <httpErrors errorMode="Detailed" /> 
     <asp scriptErrorSentToBrowser="true"/> 
     <validation validateIntegratedModeConfiguration="false" /> 
</system.webServer> 

,但仍然只顯示內部服務器錯誤消息..

+0

請檢查此問題http://stackoverflow.com/questions/5385714/ –

+0

如果在管道運行通過託管ISAPI處理程序之前發生錯誤,您將不會總是獲取YSOD - 如果發生錯誤配置文件本身,例如。 –

+0

@ebramtharwat看到我的編輯,我從其他問題添加了行,但仍然只顯示內部服務器錯誤 – Dvirski

回答

1

正如格蘭特·托馬斯提到的,它可能是與配置文件本身有問題。

我發現最簡單的方法是通過IIS嘗試打開部分配置,然後如果配置文件出現錯誤,IIS會拋出一個錯誤對話框。

因此,進入IIS,選擇有問題的網站,並嘗試打開其中一個配置節,如.Net錯誤頁面或連接字符串,看看是否出現錯誤對話框。

+0

對不起,但是什麼意思是「通過IIS打開部分配置」?你的意思是通過服務器?本地?或類似的東西?因爲我無法像那樣訪問服務器。 – Dvirski

+0

啊,對,對不起。是的,我的意思是服務器。 –

0

這是一個配置文件的錯誤。

<customErrors mode="Off"/> 

<compilation debug="true"> 

是重複的。

相關問題