1

私はいくつかのプロジェクトにsecuritySwitchを使用していますが、それは素晴らしい働きをしました。ただし、プロジェクトの1つが成長し、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変換の1つで、baseInsecureUriとbaseSecureUriを変更して別のWebサイトを指すようにする必要があります。

<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属性が宣言されていません。

「クリーンな」解決策でなくても、可能な解決策を探しています。

お時間をいただきありがとうございます!-アンドリュー

4

1 に答える 1

2

SecuritySwitchセクションの名前空間宣言を削除してみてください。これで修正されるはずです。

<securitySwitch baseInsecureUri="uriWebsite2insecure" baseSecureUri="uriWebsite2secure" bypassSecurityWarning="true" mode="RemoteOnly" xdt:Transform="Replace">
  <paths>
    <add path="~/" ignoreCase="true" />
  </paths>
</securitySwitch>

また、これら2つの属性を変更するだけの場合は、代わりにこれを試すことができます。

<securitySwitch baseInsecureUri="uriWebsite2insecure" baseSecureUri="uriWebsite2secure" xdt:Transform="SetAttributes" />
于 2012-03-28T23:07:37.457 に答える