2014-02-06 27 views
0

我需要在msbuild proj文件中的標籤內使用「>」將devenv輸出重定向到文件。我的代碼是如何在msbuild proj文件中使用「>」

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

但它不爲我工作。請回答我如何在XML標籤中使用「>」。

回答

2

使用character entities的魔法!

&gt; or &#62; 
&lt; or &#60; 
&quot; or &#34; 
&apos; or &#39; 
&amp; or &#38; 

輸出:
>或>
< 或<
"或"
'或'
&或&

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

我認爲你需要在xml中將實體字符集&amp;gt;設置爲>否則它會將該符號解釋爲標記終止字符。

+0

你忘了在{code}塊中忘記第二個:o – Nicodemeus

相關問題