Config Error: This configuration section cannot be used at this path

后端 未结 30 2056
死守一世寂寞
死守一世寂寞 2020-11-22 07:01

I\'ve encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error:

相关标签:
30条回答
  • 2020-11-22 07:38

    On Windows Server 2012 with IIS 8 I have solved this by enabling ASP.NET 4.5 feature:

    enter image description here

    and then following ken's answer.

    0 讨论(0)
  • 2020-11-22 07:38

    The best option is to Change Application Settings from the Custom Site Delegation
    Open IIS and from the root select Feature Delegation and then select Application Settings and from the right sidebar select Read/Write

    0 讨论(0)
  • 2020-11-22 07:39

    In our case on IIS 8 we found the error was produced when attempting to view Authentication" for a site, when:

    1. The server Feature Delegation marked as "Authentication - Windows" = "Read Only"
    2. The site had a web.config that explicitly referenced windows authentication; e.g.,

    Marking the site Feature Delegation "Authentication - Windows" = "Read/Write", the error went away. It appears that, with the feature marked "Read Only", the web.config is not allowed to reference it at all even to disable it, as this apparently constitutes a write.

    0 讨论(0)
  • 2020-11-22 07:40

    As per my answer to this similar issue;

    Try unlocking the relevant IIS configuration settings at server level, as follows:

    1. Open IIS Manager
    2. Select the server in the Connections pane
    3. Open Configuration Editor in the main pane
    4. In the Sections drop down, select the section to unlock, e.g. system.webServer > defaultPath
    5. Click Unlock Attribute in the right pane
    6. Repeat for any other settings which you need to unlock
    7. Restart IIS (optional) - Select the server in the Conncetions pane, click Restart in the Actions pane
    0 讨论(0)
  • 2020-11-22 07:40

    I noticed one answer that was similar, but in my case I used the IIS Configured Editor to find the section I wanted to "unlock".

    Then I copied the path and used it in my automation to unlock it prior to changing the sections I wanted to edit.

    . "$($env:windir)\system32\inetsrv\appcmd" unlock config -section:system.webServer/security/authentication/windowsAuthentication
    . "$($env:windir)\system32\inetsrv\appcmd" unlock config -section:system.webServer/security/authentication/anonymousAuthentication
    
    0 讨论(0)
  • 2020-11-22 07:40

    In my case I was getting this error when attempting to update the authentication settings in IIS also in addition to browsing. I was able to remove this error by removing the authentication setting from the web.config itself. Removing a problematic configuration section may be less invasive and preferable in some cases than changing the server roles and features too much:

    Section Removed:

        <security>
            <authentication>
                <windowsAuthentication enabled="true" />
            </authentication>
        </security>
    
    0 讨论(0)
提交回复
热议问题