我试图创建一个web.config转换文件,将appSettings值的列表更改为“false”if该名称包含单词“配置”。使用xdt:locator通过条件“starts-with”或“contains”在Web.config转换中的问题
<add name="Config.Showlog" value ="true" />
转换文件具有
<appSettings>
<add xdt:Transform="SetAttributes(value)"
value="false"
xdt:Locator="Condition(starts-with(@name,'Config')"/>
</appSettings>
Visual Studio 2010中显示了一个错误:
Condition Requires exactly 1 arguments.
我也尝试了使用XPath作为xdt:
定位器的属性,并得到了同样的错误。看起来问题来自VS 2010如何分析Condition()
或Xpath()
中的表达式。
您如何解决此问题?