MSBuild - where is everything?
MSBuild (and Visual Studio) scatter .targets and .tasks files all over the shop. Try looking in:
MSBuild (and Visual Studio) scatter .targets and .tasks files all over the shop. Try looking in:
While looking through some MSBuild scripts recently at work, I came across some stuff to do with Task output parameters that I thought might be worth blogging about. First, however, I need to talk about Task input parameters.
It’s actually quite simple:
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Default">
<ItemGroup>
<ProjectsToPublish Include="AdminConsole\AdminConsole.csproj" />
<ProjectsToPublish Include="AdminService\AdminService.csproj" />
</ItemGroup>
<Target Name="Default">
<CallTarget Targets="PublishProjectOutput" />
</Target>
<Target Name="PublishProjectOutput" Inputs="@(ProjectsToPublish)" Outputs="%(Identity).Dummy">
<Message Text="@(ProjectsToPublish)" />
</Target>
</Project>We set up an item group containing the items that we’d like to process. Our “Default” target is just to demonstrate that
we don’t need to do anything clever with CallTarget.