web-config – Web.config转换:如何将转换应用于与Locator表达
发布时间:2021-01-01 09:47:02 所属栏目:资源 来源:网络整理
导读:我最近在visual studio 2010的web部署工具中发现了web.config自动转换. 它运作良好,但我有一个我似乎无法工作的场景. 假设我有以下根Web.config services service name="Service1" endpoint address="" binding="customBinding" bindingConfiguration="Large
我最近在visual studio 2010的web部署工具中发现了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而不是Remove似乎可以解决这个问题:<services> <service> <endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="RemoveAll" /> </service> </services> (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |