【问题标题】: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 > log.txt'/>
【解决方案2】:
我认为您需要在 xml 中将> 设置为实体字符集&amp;gt;,否则它将将该符号解释为标记终止字符。