If you know where the file is that was written to you can use the ReadLinesFromFile task and then log all the messages. For example take a look at the project file below.
<Project DefaultTargets="Demo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_File>$(MSBuildProjectFullPath)</_File>
</PropertyGroup>
<Target Name="Demo">
<ReadLinesFromFile File="$(_File)">
<Output ItemName="_FileContents" TaskParameter="Lines"/>
</ReadLinesFromFile>
<Message Text="File contents: '$(MSBuildProjectFullPath)'"/>
<!-- Prints one after another with a ';' between each line -->
<Message Text="@(_FileContents)"/>
<Message Text="-------------"/>
<!-- Prints one after another with each on its own line -->
<Message Text="%(_FileContents.Identity)"/>
</Target>
</Project>
This file reads the current file (via $(MSBuildProjectFullPath)
) and prints the results to the console. I've showed how to print it out in 2 ways, one shows the ; separated values and the other shows one on a line of its own. Note that the ReadLinesFromFile task doesn't preserve leading (and maybe even trailing) white space.
Here is the result when I execute the Demo target.
C:\Data\Development\My Code\Community\MSBuild>msbuild ReadLines.proj /nologo
Build started 5/6/2010 6:29:43 PM.
Project "C:\Data\Development\My Code\Community\MSBuild\ReadLines.proj" on node 1 (default targets).
Demo:
File contents: 'C:\Data\Development\My Code\Community\MSBuild\ReadLines.proj'
<Project DefaultTargets="Demo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">;<PropertyGroup>;<_Fi
le>$(MSBuildProjectFullPath)</_File>;</PropertyGroup>;<Target Name="Demo">;<ReadLinesFromFile File="$(_File)">;<
Output ItemName="_FileContents" TaskParameter="Lines"/>;</ReadLinesFromFile>;<Message Text="File contents: '$(MS
BuildProjectFullPath)'"/>;<!-- Prints one after another with a ';' between each line -->;<Message Text="@(_FileC
ontents)"/>;<Message Text="-------------"/>;<!-- Prints one after another with each on its own line -->;<Message
Text="%(_FileContents.Identity)"/>;</Target>;</Project>
-------------
<Project DefaultTargets="Demo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_File>$(MSBuildProjectFullPath)</_File>
</PropertyGroup>
<Target Name="Demo">
<ReadLinesFromFile File="$(_File)">
<Output ItemName="_FileContents" TaskParameter="Lines"/>
</ReadLinesFromFile>
<Message Text="File contents: '$(MSBuildProjectFullPath)'"/>
<!-- Prints one after another with a ';' between each line -->
<Message Text="@(_FileContents)"/>
<Message Text="-------------"/>
<!-- Prints one after another with each on its own line -->
<Message Text="%(_FileContents.Identity)"/>
</Target>
</Project>
Done Building Project "C:\Data\Development\My Code\Community\MSBuild\ReadLines.proj" (default targets).