在web.config转换中转义字符

时间:2011-06-27 15:11:10

标签: .net xml web-config

我在Web.QA.config中有一部分XML,如下所示:

<net>
  <encryption>
    <add key="EncKey" value="stuff>stuff" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
  </encryption>
</net>

但是当我通过变换运行它时,&gt;得到转义,输出是:

<net>
  <encryption>
    <add key="EncKey" value="stuff&gt;stuff" />
  </encryption>
</net>

有什么我可以改变,以及&gt;不会被逃脱?我正在将转换添加到遗留应用程序中,这就是应用程序期望EncKey字符串的方式。

感谢。

1 个答案:

答案 0 :(得分:1)

如果从命令行运行MSBuild,则可以添加参数:

  

/ P:AutoParameterizationWebConfigConnectionStrings =假

相关问题