This configuration section cannot be used in this path. This occurs when the site administrator blocks access to this section using <location allowOverride = "false"> from a legacy configuration file.RSS

4 replies

Last post Oct 09, 2019 02:07 AM by Jalpa Panchal

  • This configuration section cannot be used in this path. This occurs when the site administrator b...

    Oct 07, 2019 06:30 PM|wes.henri.ws@gmail.com|LINK

    hello person i'm having this problem when i try to add an asp.net application on windows server 2016 iis.

    Erro de Servidor no Aplicativo '/'.


    Erro de configuração

    Descrição: Erro durante o processamento de um arquivo de configuração necessário para o serviço desta solicitação. Examine os detalhes específicos do erro e modifique esse arquivo de configuração apropriadamente.

    Mensagem de Erro do Analisador: Esta seção de configuração não pode ser usada neste caminho. Isso ocorre quando o administrador do site bloqueia o acesso a essa seção usando <location allowOverride="false"> de um arquivo de configuração herdado.

    Erro de Origem:

    Linha 21:     <add name="DefaultConnection" connectionString="Data Source= .\MANCHESTER; Initial Catalog=IndicaMais; Integrated Security=true; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    Linha 22:   </connectionStrings>
    Linha 23:   <appSettings>
    Linha 24:     <add key="webpages:Version" value="3.0.0.0" />
    Linha 25:     <add key="webpages:Enabled" value="false" />


    Arquivo de Origem: C:\Publicar2\web.config    Linha: 23

  • Re: This configuration section cannot be used in this path. This occurs when the site administrat...

    Oct 08, 2019 05:36 AM|Jalpa Panchal|LINK

    Hi,

    Could you share your web.config file?

    Is this application is working before hosting in iis?

    Make sure you enabled this below iis feature:

    Web Server
    Common HTTP Features
    Static Content
    Default Document
    Directory Browse
    Application Development
    .NET Extensibility 4.8
    .NET Extensibility
    ASP.NET 4.8
    ASP.NET
    ISAPI Extensions
    ISAPI Filters
    Management Tools
    IIS Management Console
    IIS Management Scripts and Tools
    Management Service
    Security: all the authentications
    Performance
    Static Content Compression
    Dynamic Content Compression
    Health & Diagnostics
    Logging Tools
    Tracing

    try this below steps to unlock the <appsettings> section:

    • Open iis manger. select your site.
    • Select the Configuration editor feature from the middle pane.

    • From the section dropdown list select appsetting.

    • Click the unlock section from the action pane.

    • Click on apply and restart iis server.

    For more detailed on how to host asp.net application in iis you could refer this below link:

    https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configure-an-asp-net-website-on-iis

    https://stackoverflow.com/a/57404713/11147346

    Regards,

    Jalpa

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: This configuration section cannot be used in this path. This occurs when the site administrat...

    Oct 08, 2019 01:02 PM|wes.henri.ws@gmail.com|LINK

    Hello Jalpa, yes, in another online hosting environment and debugging machine, only on windows sever 16 he is blocking appsettings.

    WebConfig

    <?xml version="1.0" encoding="utf-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      https://go.microsoft.com/fwlink/?LinkId=301880
      -->
    <configuration>
      <configSections>
        <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" />
        
      <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
      <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
     <!--<connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source= .\Hiper; Initial Catalog=IndicaMais; Integrated Security=True; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
      </connectionStrings>--> 
      
    <connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source= .\MANCHESTER; Initial Catalog=IndicaMais; Integrated Security=True; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
      </connectionStrings>
      
      <!--Teste de banco online RedeHost-->
      <!--<connectionStrings>
         <add name="DefaultConnection" connectionString="Server= **; Database=testesindicamais; User Id=**; password= **; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
      </connectionStrings>-->
       
      <!--Teste de banco online Somee-->
      <!--<connectionStrings>
          <add name="DefaultConnection" connectionString="data source=**.mssql.somee.com;Initial Catalog=**; packet size=4096;user id=**;pwd=**;persist security info=False; MultipleActiveResultSets=True;"
         providerName="System.Data.SqlClient" />      
      </connectionStrings>-->
      
      <appSettings>
        <add key="webpages:Version" value="3.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
        <add key="AdminUser" value="**@manchesterautomacao.com.br" />
        <add key="AdminPassWord" value="**" />
        <add key="SMTPName" value="smtp.manchesterautomacao.com.br" />
        <add key="SMTPPort" value="587" />
        <add key="AdminName" value="IndicaMais" />
        <add key="AdminLastName" value="Admin" />
      </appSettings>
      <!--
        Para obter uma descrição das alterações do web.config, consulte http://go.microsoft.com/fwlink/?LinkId=235367.
    
        Os seguintes atributos podem ser definidos na marca <httpRuntime>.
          <system.Web>
            <httpRuntime targetFramework="4.6.1" />
          </system.Web>
      -->
      <system.web>
      <globalization culture="pt-BR" uiCulture="pt-BR" enableClientBasedCulture="false" />
        <customErrors mode="Off" />
        <authentication mode="Forms">
          <forms cookieless="UseCookies" loginUrl="~/Conta/Login" slidingExpiration="true"></forms>
        </authentication>
        <compilation debug="true" targetFramework="4.6.1" />
        <httpRuntime targetFramework="4.6.1" />
        <httpModules>
          <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
        </httpModules>
        </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules>
          <remove name="TelemetryCorrelationHttpModule" />
          <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="managedHandler" />
          <remove name="ApplicationInsightsWebTracking" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
        </modules>
        </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
          </dependentAssembly>
           <dependentAssembly>
            <assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Common.Logging.Core" publicKeyToken="af08829b84f0328e" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.4.1.0" newVersion="3.4.1.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.4.1.0" newVersion="3.4.1.0" />
          </dependentAssembly>      
            <dependentAssembly>
            <assemblyIdentity name="Microsoft.AspNetCore.Routing" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.2.2.0" newVersion="2.2.2.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.AspNetCore.Server.IIS" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.2.6.0" newVersion="2.2.6.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.AspNetCore.Server.IISIntegration" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.2.1.0" newVersion="2.2.1.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.1.1.1" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.2.2.0" newVersion="2.2.2.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.2.1.0" newVersion="2.2.1.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.11.0.0" newVersion="2.11.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.AI.DependencyCollector" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.11.0.0" newVersion="2.11.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.AspNet.TelemetryCorrelation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.0.7.0" newVersion="1.0.7.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Configuration.CommandLine" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Configuration.EnvironmentVariables" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Caching.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.DotNet.PlatformAbstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="mssqllocaldb" />
          </parameters>
        </defaultConnectionFactory>
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="usuariosSoap" />
            <binding name="ContratoSoap" />
            <binding name="contasSoap" />
            <binding name="oportunidadesSoap" />
            <binding name="contatosSoap" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://app.omie.com.br/api/v1/crm/usuarios/" binding="basicHttpBinding" bindingConfiguration="usuariosSoap" contract="APIOmieUsuarios.usuariosSoap" name="usuariosSoap" />
          <endpoint address="http://app.omie.com.br/api/v1/servicos/contrato/" binding="basicHttpBinding" bindingConfiguration="ContratoSoap" contract="APIOmieContratos.ContratoSoap" name="ContratoSoap" />
          <endpoint address="http://app.omie.com.br/api/v1/crm/contas/" binding="basicHttpBinding" bindingConfiguration="contasSoap" contract="APIOmieContas.contasSoap" name="contasSoap" />
          <endpoint address="http://app.omie.com.br/api/v1/crm/oportunidades/" binding="basicHttpBinding" bindingConfiguration="oportunidadesSoap" contract="APIOmieOportunidades.oportunidadesSoap" name="oportunidadesSoap" />
          <endpoint address="http://app.omie.com.br/api/v1/crm/contatos/" binding="basicHttpBinding" bindingConfiguration="contatosSoap" contract="APIOmieContatos.contatosSoap" name="contatosSoap" />
        </client>
      </system.serviceModel>
      <system.codedom>
        <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
          <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
        </compilers>
      </system.codedom>
    </configuration>

  • Re: This configuration section cannot be used in this path. This occurs when the site administrat...

    Oct 08, 2019 03:17 PM|wes.henri.ws@gmail.com|LINK

    I believe it can't be the web.config settings, because everything is updating the framework less than 4.6.1

  • Re: This configuration section cannot be used in this path. This occurs when the site administrat...

    Oct 09, 2019 02:07 AM|Jalpa Panchal|LINK

    Did you try t unlock the appsettings section from the configuration editor which I mentioned in the above post? 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.