我正在尝试创建一个web.config转换文件,如果名称包含单词"Config",它将把appSettings值列表更改为"false".
<add name="Config.Showlog" value ="true" />
Run Code Online (Sandbox Code Playgroud)
转换文件有
<appSettings>
<add xdt:Transform="SetAttributes(value)"
value="false"
xdt:Locator="Condition(starts-with(@name,'Config')"/>
</appSettings>
Run Code Online (Sandbox Code Playgroud)
Visual Studio 2010显示错误:
条件正好需要1个参数.
我也尝试使用Xpath作为xdt:定位器的属性并得到相同的错误.似乎问题来自VS 2010如何解析内部Condition()或表达式Xpath().
你怎么解决这个问题?