配置錯誤:沒法在此路徑上使用此配置部分 - Config Error: This configuration section cannot be used at this path

問題:

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: 嘗試加載主頁或訪問IIS中新站點上的身份驗證時,出現錯誤: web

Config Error: This configuration section cannot be used at this path. 配置錯誤:沒法在此路徑上使用此配置部分。 This happens when the section is locked at a parent level. 當節鎖定在父級時,會發生這種狀況。 Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false". 鎖定默認狀況下是(overrideModeDefault =「 Deny」),或者是由一個帶有overlayMode =「 Deny」或舊版allowOverride =「 false」的位置標記顯式設置的。 服務器

More detail can be found here, in Scenario 7 matches my hex error code. 方案7中匹配個人十六進制錯誤代碼,能夠在這裏找到更多詳細信息。 app

The solution given on the linked site above is to set Allow for overrideModeDefault in the section mentioned in my error, in the applicationHost.config file. 上面的連接站點上給出的解決方案是在個人錯誤中提到的部分中,在applicationHost.config文件中設置Allow for overlayModeDefault。 In my case, under Security in system.webServer . 就我而言,位於system.webServer中的 Security下。 But if I look at the applicationHost.config on my local computer, where the site is properly deployed already, that section is set to Deny . 可是,若是我查看本地計算機上已經正確部署了站點的applicationHost.config ,則該部分設置爲Deny ide

If this solution is correct, how is my local instance running just fine with the same web.config ? 若是此解決方案正確,那麼個人本地實例如何在相同的web.config下正常運行? According to my applicationHost.config , that section should be locked, but it's not. 根據個人applicationHost.config ,該部分應被鎖定,但不是。 I'd prefer to not change the applicationHost.config file, because there are many other sites running on that server. 我但願不要更改applicationHost.config文件,由於該服務器上還有許多其餘站點正在運行。 Is there another solution? 還有其餘解決方案嗎? 網站


解決方案:

參考一: https://stackoom.com/question/f67d/配置錯誤-沒法在此路徑上使用此配置部分
參考二: https://oldbug.net/q/f67d/Config-Error-This-configuration-section-cannot-be-used-at-this-path
相關文章
相關標籤/搜索