【问题标题】:How to use ">" in msbuild proj file如何在 msbuild proj 文件中使用“>”
【发布时间】:2014-02-06 15:12:56
【问题描述】:

我需要在 msbuild proj 文件中的标记内使用“>”将 devenv 输出重定向到文件。我的代码是

<Exec Command='"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /build "Release|x86" ..\MySolution.sln ">" log.txt'/>

但这对我不起作用。请回答我如何在 xml 标签中使用“>”。

【问题讨论】:

    标签: msbuild projects-and-solutions


    【解决方案1】:

    使用character entities的魔力!

    > or >
    < or <
    " or "
    ' or '
    & or &
    

    输出:
    > 或 >
    " 或 "
    ' 或 '
    & 或 &

    <Exec Command='"C:\Program Files (x86)\Microsoft Visual Studio 
    9.0\Common7\IDE\devenv.exe" /build "Release|x86" ..\MySolution.sln &gt; log.txt'/>
    

    【讨论】:

      【解决方案2】:

      我认为您需要在 xml 中将&gt; 设置为实体字符集&amp;amp;gt;,否则它将将该符号解释为标记终止字符。

      【讨论】:

      • 嘿,你忘了在 {code} 块中转义第二个:o
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-12
      • 2014-04-01
      相关资源
      最近更新 更多