MSBuild.Task output for solution files
Hi,
I have two questions.
1) We are using MSBuild to organize a series of solutions. MSBuild does not seem to be able to capture the TargetOutputs parameter of the MSBuild task if you build a solution. As a matter of fact, it crashes. I would like to get a list of DLLs that were built as part of the solution. That does not appear to be possible with a solution and the MSBuild.Task output. It works fine for a single project.
2) Is the scope of ItemNames which are populated through an output element limited to the current target? If I build a single project instead of a solution, the output parameter of the MSBuild task does return the DLL. If I reference the ItemName outside the scope of the current target, however, it is empty.
Is there any way to populate such a list incrementally in sequential task so that in the end you'd have a list of all DLLs built in the various solution targets?
I suppose you could accomplish this goal by cleaning the output directory and then reading in the files from that directory. That becomes cumbersome if not all solutions build to the same output directory, however.
Any suggestions on how to best accomplish this? Thanks.
<
<
TargetName="Test"><MSBuildProjects="Test.sln" ><OutputTaskParameter="TargetOutputs"ItemName="AssembliesBuiltByChildProjects"/></MSBuild><MessageText="This is the list of built DLLs: @(AssembliesBuiltByChildProjects)"/></Target>
<!--Message statement returns DLL when building a project, crashes MS build when building a solution-->
<TargetName="Test"><MSBuildProjects="Test1.sln" >
<OutputTaskParameter="TargetOutputs"ItemName="AssembliesBuiltByChildProjects"/></MSBuild>
</Target>
<TargetName="Build"><MSBuildProjects="$(MSBuildProjectFullPath)"Targets="Test,Test1"RunEachTargetSeparately="false"StopOnFirstFailure="true"/> </
<MessageText="This is the list of built DLLs returns nothing: @(AssembliesBuiltByChildProjects)"/>
<!--Message statement returns empty string when referencing ItemName
@(AssembliesBuiltByChildProjects). The same message statement in the Test target works. Anyway to make an ItemName visible to other targets-->
</Project>

