gpt4 book ai didi

wcf - Set-WebConfigurationProperty失败

转载 作者:行者123 更新时间:2023-12-03 01:22:50 26 4
gpt4 key购买 nike

我正在尝试使用Powershell在IIS中的站点上设置Windowsauth,该脚本的这一部分到目前为止已在所有环境中工作,但现在失败了,我不知道为什么。

Set-WebConfigurationproperty system.webServer/security/authentication/anonymousAuthentication -name enabled -value false -PSPath "IIS:\" -location $siteName
Set-WebConfigurationproperty system.webServer/security/authentication/windowsAuthentication -name enabled -value true -PSPath "IIS:\" -location $siteName

任何人都知道为什么该脚本会失败?

我收到“无法读取配置节'system.serviceModel',因为它缺少节声明”

我可以手动启用Windows身份验证,并且站点旋转得很好。

干杯

最佳答案

因此,事实证明该问题未安装.Net 3.5。

由于Powershell在未安装3.5的.Net2 CLR下运行,因此不知道web.config中的system.serviceModel。

一旦安装了3.5脚本就可以正常运行

关于wcf - Set-WebConfigurationProperty失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7670002/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com