msbuild / VS integration - print msbuild messages to output window

C

ccallen

How to print msbuild <Message> to the VS 2005 output window, from an msbuild
file that is loaded into VS?

After reading Don Boxs' "MSBuild for MAKEFILE converts" [1], I copied the
snippet, for point 2, into a text file (test.csproj) and loaded the project
into Visual Studio. That was cool, I could see the project and the code file
(f1.txt) displayed in the Solution Explorer. After building it a few times,
I wanted to see the exact order that VS executed the targets, so I added a
<Message> tag to each <Target> [2]. However VS did not display the messages
to the output window as I thought.

Q. Does anyone know how to do this?
Q. Would it require creating a custom task?

Thanks, Conan

[1] - "MSBuild for MAKEFILE converts"
http://pluralsight.com/blogs/dbox/archive/2005/07/18/13377.aspx


[2] Point 2 snippet

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="all">
<ItemGroup>
<IntermediateFile Include="f2.txt" >
<InProject>false</InProject>
</IntermediateFile>
<InputFile Include="f1.txt" />
</ItemGroup>
<Target Name="all" DependsOnTargets="t1;t2">
<Message Text="all" />
</Target>
<Target Name="clean">
<Delete Files="f3.txt;f4.txt" />
<Message Text="clean" />
</Target>
<Target Name="rebuild" DependsOnTargets="clean;all">
<Message Text="rebuild" />
</Target>
<Target Name="t1" Inputs="@(InputFile)" Outputs="f3.txt">
<Copy SourceFiles="@(InputFile)" DestinationFiles="@(IntermediateFile)"
/>
<Copy SourceFiles="@(IntermediateFile)" DestinationFiles="f3.txt" />
<Delete Files="@(IntermediateFile)" />
<Message Text="t1" />
</Target>
<Target Name="t2" Inputs="@(InputFile)" Outputs="f4.txt">
<Copy SourceFiles="@(InputFile)" DestinationFiles="f4.txt" />
<Message Text="t2" />
</Target>
</Project>
 
Top