小编Pat*_*att的帖子

在Web.config转换中使用条件"starts-with"或"contains"使用xdt:locator的问题

我正在尝试创建一个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().

你怎么解决这个问题?

web-config-transform

5
推荐指数
1
解决办法
3453
查看次数

标签 统计

web-config-transform ×1