配置错误:此配置部分不能用于此路径 [英] Config Error: This configuration section cannot be used at this path

查看:16
本文介绍了配置错误:此配置部分不能用于此路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将站点部署到服务器时遇到错误.尝试在 IIS 中加载主页或访问新站点上的身份验证时,出现错误:

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:

配置错误:此配置部分不能在此路径中使用.当该部分锁定在父级别时会发生这种情况.锁定是默认情况下 (overrideModeDefault="Deny"),或由带有 overrideMode="Deny" 或旧版的位置标签allowOverride="false".

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".

更多细节可以在这里找到,在 场景 7 匹配我的十六进制错误代码.

More detail can be found here, in Scenario 7 matches my hex error code.

上面链接网站上给出的解决方案是在 applicationHost.config 文件中我的错误中提到的部分中为 overrideModeDefault 设置 Allow.在我的例子中,在 system.webServer 中的 Security 下.但是,如果我查看本地计算机上的 applicationHost.config,该站点已经正确部署,该部分设置为 Deny.

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. In my case, under Security in system.webServer. 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.

如果这个解决方案是正确的,我的本地实例如何在相同的 web.config 下运行得很好?根据我的 applicationHost.config,该部分应该被锁定,但事实并非如此.我宁愿不更改 applicationHost.config 文件,因为该服务器上运行着许多其他站点.还有其他解决方案吗?

If this solution is correct, how is my local instance running just fine with the same web.config? According to my applicationHost.config, that section should be locked, but it's not. I'd prefer to not change the applicationHost.config file, because there are many other sites running on that server. Is there another solution?

推荐答案

我也遇到了同样的问题.不记得我在网上哪里找到的,但这是我做的:

I had the same problem. Don't remember where I found it on the web, but here is what I did:

  • 点击开始按钮"
  • 在搜索框中输入打开或关闭 Windows 功能"
  • 在功能窗口中,单击:Internet Information Services"
  • 点击:万维网服务"
  • 点击:应用程序开发功能"
  • 检查(启用)这些功能.我检查了除了 CGI 之外的所有内容.

顺便说一句,我使用的是 Windows 7.多年来,许多评论都证明它在 Windows 10 和 Server 2019 上也能正常工作.

btw, I'm using Windows 7. Many comments over the years have certified this works all the way up to Windows 10 and Server 2019, as well.

这篇关于配置错误:此配置部分不能用于此路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆