Мне известно, что есть вопросы, похожие на эту проблему. Я работаю над проектом .Net, и до вчерашнего дня он работал нормально. Сегодня я вижу ошибку в моем конфигурационном файле.
Ошибка, которую я получил:
Раздел конфигурации 'system.web / httpModules' уже определен. Разделы должны появляться только один раз для каждого файла конфигурации. Смотрите раздел справки для исключений '
Ниже мой конфигурационный файл:
Я не уверен, какой HttpModule должен быть удален: (
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
</configSections>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
<add key="Internal" value="localhost;localhost2" />
<add key="External" value="localhost33" />
</appSettings>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000" />
</webServices>
</scripting>
</system.web.extensions>
<connectionStrings></connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<!--Fix for placing secure flag on session cookie-->
<!--<httpCookies requireSSL="true"/>-->
<!--<roleManager enabled="true" />-->
<authentication mode="Forms">
<!--<forms loginUrl="login.aspx" timeout="9880" requireSSL="true" />-->
<forms loginUrl="login.aspx" timeout="9880" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
<membership defaultProvider="ProjectNameProvider">
<providers>
<clear />
<add name="ProjectNameProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=***" connectionStringName="****" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="***" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="ProjectNameProvider">
<providers>
<clear />
<add name="ProjectNameProvider" connectionStringName="***" applicationName="***" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=***" />
</providers>
</roleManager>
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
<!--<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />-->
</controls>
</pages>
<machineKey decryptionKey="AutoGenerate,IsolateApps" validationKey="AutoGenerate,IsolateApps" />
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
</system.web>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<!-- FORGOT SECURITY -->
<location path="Service/General.asmx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Accounts_Internal/New_Accounts.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Forgot/Forgot.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Forgot/Forgot_Reset.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Forgot/Forgot_Expired.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.webServer>
<defaultDocument>
<files>
<remove value="Login.aspx" />
<add value="Login.aspx" />
</files>
</defaultDocument>
<modules>
<remove name="Elmah.ErrorLog" />
<remove name="Elmah.ErrorMail" />
<remove name="Elmah.ErrorFilter" />
<add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="Elmah.ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<!--
<rewrite><rules><rule name="Add WWW" enabled="true" stopProcessing="true"><match url="^(.*)$" /><conditions><add input="{HTTP_HOST}" pattern="^(?!www\.)(.*)$" /></conditions><action type="Redirect" url="https://www.{C:0}{PATH_INFO}" redirectType="Permanent" /></rule></rules></rewrite>
-->
<httpProtocol>
<customHeaders>
<remove name="X-Frame-Options" />
<add name="X-Frame-Options" value="DENY" />
<!--<add name="Strict-Transport-Security" value="max-age=31536000"/>-->
</customHeaders>
</httpProtocol>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<elmah>
<errorLog applicationName="***" type="Elmah.SqlErrorLog, Elmah" connectionStringName="SQLErrorConnection" />
<errorMail />
<!--
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
more information on remote access and securing ELMAH.
-->
<security allowRemoteAccess="false" />
</elmah>
<location>
<system.web>
<customErrors mode="Off" />
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
</system.web>
</location>
<runtime>
<assemblyBinding
xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.6.0" newVersion="1.8.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<location path="elmah.axd" inheritInChildApplications="false">
<system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<!--
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
more information on using ASP.NET authorization securing ELMAH.
<authorization><allow roles="admin" /><deny users="*" /></authorization>
-->
</system.web>
<system.webServer>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
</location>
</configuration>