【发布时间】:2017-07-26 10:53:33
【问题描述】:
在准备将一些应用程序移动到 IIS 8 时,我在 Windows 10 和 Windows Server 2012 R2 上遇到 hresult:c00cef03 错误,当使用 appcmd.exe 或 inetmgr 对 web.config 进行更改时,只要 web.config 文件包含 runtime/assemblyBinding 元素。
以前有人见过这种情况吗?解决方法是什么?
以下是 appcmd 输出的示例:
C:>C:\Windows\System32\inetsrv\appcmd.exe set config "Default Web Site/Configuration" -section:anonymousAuthentication /username
:""
Applied configuration changes to section "system.webServer/security/authenticati
on/anonymousAuthentication" for "MACHINE/WEBROOT/APPHOST/Default Web Site/Config
uration" at configuration commit path "MACHINE/WEBROOT/APPHOST/Default Web Site/
Configuration"
ERROR ( hresult:c00cef03, message:Failed to commit configuration changes.
)
以下是您可以用来重现问题的 web.config 文件的内容。似乎只有元素的存在就会导致错误发生,程序集的身份无关紧要。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" userName="IUSR" />
</authentication>
</security>
</system.webServer>
<runtime>
<asm:assemblyBinding xmlns:asm="urn:schemas-microsoft-com:asm.v1">
<asm:dependentAssembly>
<asm:assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<asm:bindingRedirect oldVersion="4.5.0.0-9.0.0.0" newVersion="9.0.0.0" />
</asm:dependentAssembly>
</asm:assemblyBinding>
</runtime>
</configuration>
【问题讨论】:
-
Windows 10 运行 IIS 10。
-
我可以重现此问题,但找不到简单的解决方法。在这种情况下,即使是 IIS Manager 也无法进行更改,因此应该是 MWA 的错误。
-
我认为原因是
<runtime>标签及其子标签在 IIS 中没有注册响应架构信息。是否可以通过添加架构文件来解决此问题。 -
我在 2012R2 架构中找不到
标记,在 2008R2 架构中也找不到;但是2008R2没有这样的问题。原因可能是别的。
标签: iis-8