我在我的一些项目中使用了securitySwitch,并且效果很好。但是,我的一个项目已经增长,我无法在 securitySwitch 配置部分执行任何 web.config 转换。
所以,在我的 web.config 中,我有以下内容:
<securitySwitch baseInsecureUri="uriWebsite1insecure" baseSecureUri="uriWebsite1secure" bypassSecurityWarning="true" mode="RemoteOnly" xmlns="http://SecuritySwitch-v4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SecuritySwitch-v4.xsd">
<paths>
<add path="~/" ignoreCase="true" />
</paths>
</securitySwitch>
但是,在我的 web.config 转换之一中,我需要更改 baseInsecureUri 和 baseSecureUri 以指向不同的网站:
<securitySwitch baseInsecureUri="uriWebsite2insecure" baseSecureUri="uriWebsite2secure" bypassSecurityWarning="true" mode="RemoteOnly" xmlns="http://SecuritySwitch-v4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SecuritySwitch-v4.xsd" xdt:Transform="Replace">
<paths>
<add path="~/" ignoreCase="true" />
</paths>
</securitySwitch>
它给出了以下错误:http://schemas.microsoft.com/XML-Document-Transform:Transform属性未声明。
我正在寻找任何可能的解决方案,即使它不是“干净”的解决方案。
感谢您的时间!- 安德鲁