PC Review


Reply
Thread Tools Rate Thread

msbuild / VS integration - print msbuild messages to output window

 
 
ccallen
Guest
Posts: n/a
 
      23rd Jul 2006
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/ar.../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>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSBuild shapper Microsoft C# .NET 0 7th Mar 2009 02:22 AM
visual source safe integration nAnt vs MsBuild gaddoz Microsoft ASP .NET 1 21st Nov 2006 02:28 AM
Where do I get MSBuild? Ed Sutton Microsoft C# .NET 11 11th Sep 2006 10:55 PM
MSbuild not building. no helpful error messages. =?Utf-8?B?cm9nZXIyMw==?= Microsoft ASP .NET 0 27th May 2006 07:01 PM
msbuild =?Utf-8?B?Y2lzY28=?= Microsoft Dot NET 4 28th Jan 2006 02:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:18 PM.