该错误表示配置部分已锁定在父级别。 所以它不会直接1个配置文件来解决问题, 我们需要通过配置文件的层次结构来查看继承 检查以下链接以浏览IIS中的文件层次结构和继承
https://msdn.microsoft.com/en-us/library/ms178685.aspx
因此,您需要按以下顺序检查应用配置设置
仔细检查所有这些配置,大约1到6,你应该找到它。
你也可以使用 的 IIS管理器 强> 编辑这些设置。
关心这个 学习IIS文章 :
使用 的 特征授权 强> 从IIS的根目录:
然后,您可以控制每个机器级读/写权限,否则将为您提供 overrideMode = “拒绝” 错误。
要在应用程序级别(Web.Config)进行更改:
请从web.config中删除Trust Level:
实际上,当我试图在托管服务器上托管我的网站时,我收到了这个错误,我无法控制他们的服务器。从我的应用程序web.config中删除上面的行解决了我的问题。
当我收到这条好消息时,我需要更改子文件夹上的SSL设置。在我的情况下,以下行动帮助了我。
打开C:\ Windows \ System32 \ inetsrv \ config \ applicationHost.config
并将值从overrideModeDefault =“Deny”更改为“Allow”
<sectionGroup name="system.webServer"> ... <sectionGroup name="security"> <section name="access" overrideModeDefault="Allow" /> </sectionGroup>
你能试试这个:
转到应用程序路径,您将收到拒绝错误,右键单击
的 属性 - >安全选项卡 强>
在那里,更改权限并选中读取和写入复选框。然后它可以毫无错误地工作。
上 Windows Server 2012 同 IIS 8 我通过启用解决了这个问题 ASP.NET 4.5 特征:
然后跟着 肯的回答 。
Powershell启用这些功能的方法(Windows Server 2012 +) - 根据需要进行修剪:
Install-WindowsFeature NET-Framework-Core Install-WindowsFeature Web-Server -IncludeAllSubFeature Install-WindowsFeature NET-Framework-Features -IncludeAllSubFeature Install-WindowsFeature NET-Framework-45-ASPNET -IncludeAllSubFeature Install-WindowsFeature Application-Server -IncludeAllSubFeature Install-WindowsFeature MSMQ -IncludeAllSubFeature Install-WindowsFeature WAS -IncludeAllSubFeature
似乎在IIS Express和VS 2015中,$(solutionDir).vs \ config \ applicationhost.config中有applicationHost.config文件的副本,因此您需要在那里进行更改。看到这个链接: http://digitaldrummerj.me/iis-express-windows-authentication/
确保以下方式更改这些行:
<section name="windowsAuthentication" overrideModeDefault="Allow" /> <section name="anonymousAuthentication" overrideModeDefault="Allow" /> <add name="WindowsAuthenticationModule" lockItem="false" /> <add name="AnonymousAuthenticationModule" lockItem="false" />
浏览到 C:\ Windows \ System32 \ inetsrv \config (这里需要管理员权限) 打开applicationHost.config
的 注意 强> :在IISExpress和Visual Studio 2015中,applicationHost.config存储在 $(solutionDir).vs\config\applicationhost.config
$(solutionDir).vs\config\applicationhost.config
找到错误消息页面的 config源 部分中显示的部分。对我来说,这通常是 模块 或 handlers
改变 overrideModeDefault 属性是 Allow
overrideModeDefault
Allow
所以整条线现在看起来像:
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
保存文件后,页面在我的浏览器中正常加载。
的 警告: 强> 在64位Windows上编辑applicationHost.config
在Vista Home Premium上安装IIS 7后收到同样的问题。为了纠正错误,我更改了位于Windows \ system32 \ inetsrv中的applicationHost.config文件中的以下值。
更改位于 - &gt;部分中的所有以下值
<div mce_keep="true"><section name="handlers" overrideModeDefault="Deny" /> change this value from "Deny" to "Allow"</div> <div mce_keep="true"><section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" /> change this value from "Deny" to "Allow"</div>
在我的情况下,在.NET Framework功能下,服务器上没有启用“HTTP激活”。因此,对于Windows Server 2012,适用于我的解决方案是:
服务器管理器 - &gt;添加角色和功能 - &gt;特点 - &gt;确保在您要使用的.NET Framework版本下选中“HTTP激活”
我有一个问题,我在输入override =“允许”值(这里已经提到过)......但是在x64位系统上.......我的32个记事本++是幻像保存它们。切换到记事本(x64位O / S上的64位应用程序)允许我保存设置。
见:
http://dpotter.net/technical/2009/11/editing-applicationhostconfig-on-64-bit-windows/
相关文字:
我遇到的一个问题是我查看并可能编辑applicationHost.config。此文件位于%SystemRoot%\ System32 \ inetsrv \ config。看起来很简单。我能够轻松地从命令行中找到它,但是当我在我最喜欢的编辑器(Notepad ++)中加载它时,我找到了一个找不到文件的错误。原来,System32文件夹被重定向到32位应用程序到SysWOW64。似乎无法使用32位应用程序查看System32文件夹。去搞清楚。 幸运的是,64位版本的Windows附带64位版本的记事本。尽管我不喜欢它,但至少它是有效的。
这对我有用 同样在IIS 8中,您可以通过将服务器更改为IIS Express来解决此问题。转到debug-&gt;属性 在Web中,从下拉列表中选择服务器作为IIS Express,然后重建解决方案
在我的情况下,它是另一回事。
的 当我在新版本的Visual Studio中加载解决方案时,VS显然创建了一个新的项目特定的applicationhost.config文件: 强>
的 MySolutionDir \ .VS \设置\对ApplicationHost.config 强>
它开始使用新配置中的设置,而不是我已经自定义的全局IIS Express设置。 (\用户\%USER%\文件\ IISExpress \配置\对ApplicationHost.config)
在我的情况下,这是需要设置的设置。当然,它可能是你的另一个东西:
<section name="ipSecurity" overrideModeDefault="Allow" />
最好的选择是改变 Application Settings 来自 Custom Site Delegation 打开 IIS 并从根选择 Feature Delegation 然后选择 Application Settings 并从右侧边栏选择 Read/Write
Application Settings
Custom Site Delegation
IIS
Feature Delegation
Read/Write
以下对我有用:
转到项目属性。网页标签。设置为本地IIS并设置特定页面。
我有Windows 7和Visual Studio 2013。
对于IIS 8 Windows Server 2012 R2,这对我来说是个窍门
转到“打开功能”
然后转到所有默认设置,Next,Next,Next等。
然后,选择如下所示,
然后重置IIS(可选),但做得更安全一面。
这是一个额外的解决方案,因为它是一个通用问题,每个人都有不同的问题,因此不同的解干杯!
的 对于胜利10 强> (也可能适用于其他Windows版本。)
的 1。 强> 打开“ 的 打开或关闭Windows功能 强> “by:WinKey + R =&gt;”optionalfeatures“=&gt;好的
在我的情况下,我收到此错误,因为我在错误的配置文件上操作。
我这样做:
Configuration config = serverManager.GetWebConfiguration(websiteName); ConfigurationSection serverRuntimeSection = config.GetSection("system.webServer/serverRuntime"); serverRuntimeSection["alternateHostName"] = hostname;
而不是正确的代码:
Configuration config = serverManager.GetApplicationHostConfiguration(); ConfigurationSection serverRuntimeSection = configApp.GetSection("system.webServer/serverRuntime", websiteName); serverRuntimeSection["alternateHostName"] = hostname;
换句话说,我试图在网站的web.config上运行而不是全局文件C:\ Windows \ System32 \ inetsrv \ config \ applicationHost.config,它有一个网站的部分(或可以有一个部分)。我尝试更改的设置仅存在于applicationHost.config文件中。
我需要从命令提示符运行这两个命令:
%windir%/system32/inetsrv/appcmd unlock config /section:anonymousAuthentication %windir%/system32/inetsrv/appcmd unlock config -section:windowsAuthentication
我解决了这个问题
转到cmd并执行aspnet_regiis -i
希望对某人有所帮助。
要解决此问题,请打开IIS Express applicationhost.config。此文件存储在C:\ Users [您的用户名] \ Documents \ IISExpress \ config \ applicationhost.config中
VS2015 +的更新:配置文件位置是$(solutionDir).vs \ config \ applicationhost.config
寻找以下几行
<section name="windowsAuthentication" overrideModeDefault="Deny" /> <section name="anonymousAuthentication" overrideModeDefault="Deny" /> <add name="WindowsAuthenticationModule" lockItem="true" /> <add name="AnonymousAuthenticationModule" lockItem="true" />
的 将这些行更改为 强>
保存并刷新Asp.net页面。
对于 的 Windows Server 2012 强> 和 的 IIS 8 强> ,程序类似。
该 Web Server (IIS) 和 Application Server 应该安装,你也应该有可选的 Web Server (IIS) Support 下 Application Server 。
Web Server (IIS)
Application Server
Web Server (IIS) Support
我遇到过同样的问题。
在我的情况下,除了浏览之外,我在尝试更新IIS中的身份验证设置时收到此错误。我可以通过从web.config本身删除身份验证设置来删除此错误。删除有问题的配置部分可能侵入性较小,在某些情况下比将服务器角色和功能更改过多更为可取:
的 删除部分: 强>
<security> <authentication> <windowsAuthentication enabled="true" /> </authentication> </security>
在我们的IIS 8案例中,我们发现在尝试查看网站的身份验证时出现错误,时间:
标记站点功能委派“身份验证 - Windows”=“读/写”,错误消失了。看来,使用标记为“只读”的功能,web.config根本不允许引用它甚至禁用它,因为这显然构成了写入。
对于Windows Server 2008和IIS 7,过程类似。 请参考: http://msdn.microsoft.com/en-us/library/vstudio/bb763178(v=vs.100).aspx
在添加角色服务中,您将看到“应用程序开发功能”
检查(启用)功能。我检查了所有。