Question

I need to use ">" inside a tag in msbuild proj file to redirect devenv output to a file. My code is

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

But it does not work for me. Please answer me how to use ">" inside xml tag.

Was it helpful?

Solution

Use the magic of character entities!

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

Output:
> 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'/>

OTHER TIPS

I think you need to set > to the entity charset &amp;gt; in xml, else it interprets the symbol as a tag termination character.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top