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

后端 未结 30 2599
死守一世寂寞
死守一世寂寞 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:13

    The error says that the configuration section is locked at the parent level. So it will not be directly 1 config file which will resolve the issue, we need to go through the hierarchy of the config files to see the inheritance Check the below link to go through the File hierarchy and inheritance in IIS

    https://msdn.microsoft.com/en-us/library/ms178685.aspx

    So you need to check for the app config settings in the below order

    1. ApplicationHost.config in C:windows\system32\inetsrv\config. Change the overrideModeDefault attribute to be Allow.
    2. ApplicationName.config or web.config in the applications directory
    3. Web.config in the root directory.
    4. Web.config in the specific website (My issue was found at this place).
    5. Web.config of the root web (server's configuration)
    6. machine.config of the machine (Root's web.config and machine.config can be found at - systemroot\MicrosoftNET\Framework\versionNumber\CONFIG\Machine.config)

    Go carefully through all these configs in the order of 1 to 6 and you should find it.

提交回复
热议问题