web.config変換:ロケーター式に一致するすべてのノードに変換を適用する方法は?
-
08-10-2019 - |
質問
私は最近、Visual Studio 2010のWebデプロイツールでWeb.Config自動変換を発見しました。それはうまく機能していますが、機能することができないようです。次のルートweb.configがあると仮定します
<services>
<service name="Service1">
<endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
contract="Service1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="Service2">
<endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
contract="Service2" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="Service3">
<endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
contract="Service3" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
私のweb.release.configのために、私は欲しいです mexhttpbindingの結合を伴うすべてのエンドポイントノード 削除されます。
私は自分のweb.release.configで以下を使用しました:
<services>
<service>
<endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="Remove" />
</service>
</services>
ただし、これはService1で最初の一致のみを削除しますが、次の試合は削除されません。エンドポイントとサービスノードでノードを見つけるさまざまな方法を試しましたが、最初の試合のみが交換されました。
すべてを取得する方法はありますか <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
削除されますか?
ありがとう。
解決
私はこれを試してみましたが、削除する代わりにRemoveallを使用することはトリックをするようです:
<services>
<service>
<endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="RemoveAll" />
</service>
</services>
所属していません StackOverflow