如何确定哪个父配置文件锁定了web。配置设置?

时间:2021-10-13 20:19:30

When I open my ASP.NET site in IIS and try to open the .NET Trust Levels, I get an error message:

当我打开我的ASP。NET站点在IIS中,尝试打开.NET信任级别,我得到一个错误消息:


.NET Trust Levels There was an error while performing this operation.

在执行此操作时,. net信任级别存在一个错误。

Details:

细节:

Filename: \?\C:\inetpub\wwwroot\myapp\web.config

文件名:\ ? \ C:\ inetpub \ wwwroot \ myapp \ web . config

Line number: 445

行号:445

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"),要么是由一个带有overrideMode="Deny"或遗留allowOverride="false"的位置标记显式设置的。


I've checked a few places, but I haven't found anything that seems like it would be locking that setting. Is there a systematic way of determining where that setting is locked?

我已经检查了一些地方,但是我没有发现任何看起来会锁定该设置的东西。有没有一种系统的方法来确定设置锁在哪里?

I'm using IIS 7.5 and .NET 3.5 sp1.

我使用的是IIS 7.5和。net 3.5 sp1。

2 个解决方案

#1


3  

I haven't figured out how to determine exactly which file is locking any given setting, but if you select the very top node in IIS (it should be your machine name) and then open up Feature Delegation, the status bar will read 'Configuration: 'localhost' root web.config' or something similar.

我还没有弄清楚如何确定哪个文件正在锁定任何给定的设置,但是如果您选择IIS中的最顶端节点(它应该是您的机器名),然后打开特性委托,状态栏将显示“Configuration: 'localhost'根web。配置”或类似的东西。

From here you can modify which settings are locked at the child level.

从这里可以修改在子级别上锁定的设置。

如何确定哪个父配置文件锁定了web。配置设置?

#2


0  

Both IIS and ASP.NET supports locking particular configuration sections. Typical scenarios are nested config files - for example, you may have a config file at a child directory overriding some config settings (at child level) from web site level config file. So in such case, parent can decide what sections in config files are allowed to override. I believe the concept exists in ASP.NET since version 2.0 while xml configuration appeared since IIS 7 and it also supports similar cases.

IIS和ASP。NET支持锁定特定的配置部分。典型的场景是嵌套的配置文件——例如,您可能在子目录中有一个配置文件,覆盖web站点级别的配置文件中的一些配置设置(在子级别)。因此,在这种情况下,父类可以决定在配置文件中允许覆盖哪些部分。我相信这个概念存在于ASP中。NET从2.0版本开始,而xml配置出现在IIS 7之后,它也支持类似的情况。

See this article to understand locking config sections in ASP.NET and this article for the same in IIS. Note that configuration file hierarchy as such start from machine config and root level web config - so in unlikely case, your web config may be trying to override allowed sections from these files.

请参阅本文以了解ASP中的锁定配置部分。NET和本文在IIS中相同。注意,配置文件层次结构是从机器配置和根级别web配置开始的——因此,在不太可能的情况下,您的web配置可能试图覆盖这些文件中的允许部分。

#1


3  

I haven't figured out how to determine exactly which file is locking any given setting, but if you select the very top node in IIS (it should be your machine name) and then open up Feature Delegation, the status bar will read 'Configuration: 'localhost' root web.config' or something similar.

我还没有弄清楚如何确定哪个文件正在锁定任何给定的设置,但是如果您选择IIS中的最顶端节点(它应该是您的机器名),然后打开特性委托,状态栏将显示“Configuration: 'localhost'根web。配置”或类似的东西。

From here you can modify which settings are locked at the child level.

从这里可以修改在子级别上锁定的设置。

如何确定哪个父配置文件锁定了web。配置设置?

#2


0  

Both IIS and ASP.NET supports locking particular configuration sections. Typical scenarios are nested config files - for example, you may have a config file at a child directory overriding some config settings (at child level) from web site level config file. So in such case, parent can decide what sections in config files are allowed to override. I believe the concept exists in ASP.NET since version 2.0 while xml configuration appeared since IIS 7 and it also supports similar cases.

IIS和ASP。NET支持锁定特定的配置部分。典型的场景是嵌套的配置文件——例如,您可能在子目录中有一个配置文件,覆盖web站点级别的配置文件中的一些配置设置(在子级别)。因此,在这种情况下,父类可以决定在配置文件中允许覆盖哪些部分。我相信这个概念存在于ASP中。NET从2.0版本开始,而xml配置出现在IIS 7之后,它也支持类似的情况。

See this article to understand locking config sections in ASP.NET and this article for the same in IIS. Note that configuration file hierarchy as such start from machine config and root level web config - so in unlikely case, your web config may be trying to override allowed sections from these files.

请参阅本文以了解ASP中的锁定配置部分。NET和本文在IIS中相同。注意,配置文件层次结构是从机器配置和根级别web配置开始的——因此,在不太可能的情况下,您的web配置可能试图覆盖这些文件中的允许部分。