2012-02-12 14 views
9

ウェブページをサーバーにアップロードしました。設定セクション 'customErrors'にセクション宣言がないため、読み込めません

私のウェブページはローカルシステムで正常に動作しています。私はそれをサーバーにアップロードするときしかし、セクション宣言が欠落している あるので、読むことができないエラーに

構成セクション「のcustomErrors」を示しています。

私はすべての可能性を試しましたが、依然として上記のエラーが発生しています。誰でも私の設定ファイルで問題を解決するために何を変更すべきなのかを提案できますか?

マイWebConfigのファイル:

<configuration> 
    <configSections> 
     <section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true" /> 
     <sectionGroup name="modulesSection"> 
      <section name="rewriteModule" type="RewriteModule.RewriteModuleSectionHandler, RewriteModule" /> 
     </sectionGroup> 
    </configSections> 
    <!-- <customErrors mode="ON" /> --> 
    <!-- <customErrors mode="Off" /> --> 
    <customErrors mode="ON" defaultRedirect="GenericErrorPage.html"> 
     <!-- <error statusCode="403" redirect="NoAccess.htm" /> 
      <error statusCode="404" redirect="FileNotFound.htm" /> --> 
    </customErrors> 
    <modulesSection> 
     <rewriteModule> 
      <rewriteOn>true</rewriteOn> 
      <rewriteRules> 
      <rule source="http://[^/]*/*(\w+[&amp;-]*\w+)/*((\w+[&amp;-]*\w+)(\s)*)*/*((\w+[&amp;-]*\w+)(\s)*)*$" destination="landPage.aspx?CampaginName=$1&amp;SubDomain=$2&amp;UserName=$3&amp;PageName=$4" /> 
      <!-- <rule source=".*" destination="landPage.aspx?CampaginName=$1&amp;UserName=$2"/>--> 
      </rewriteRules> 
     </rewriteModule> 
    </modulesSection> 

答えて

18

<CustomErrors>あなたが直接<configuration>の下にあなたを持っている<system.web>の下に行きます。つまり、customErrorsタグの親要素はconfigurationです。これは間違っています。 MSDN on customErrorsをチェックすると、それを設定ファイルに追加する正しい構造が表示されます。

<configuration> 
    <!-- your other stuff --> 
    <system.web> 
     <customErrors mode="ON" defaultRedirect="GenericErrorPage.html"> 
      <!-- <error statusCode="403" redirect="NoAccess.htm" /> 
      <error statusCode="404" redirect="FileNotFound.htm" /> --> 
     </customErrors> 
    </system.web> 
</configuration> 
+0

ご返信ありがとうございます。これを実行すると、「認識できない要素 'system.web'」というエラーが表示されます –

+1

私はあなたのsystem.webが別のセクションの中にネストされているか、またはconfigSectionsの前に一番上にあると思います。 ''があなたの ' 'の後に来ることを確認してください。 –

+0

あなたが正しいです。 あなたのご協力ありがとうございました... –

関連する問題