我試圖創建一個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()
中的表達式。
您如何解決此問題?