MSBuild TargetOutputs Question.

I'm rather new to MSBuild. I'm trying to build a project and copy the
build result to a deploy folder. Here is the target I created for this.

<Target Name="BuildModelEvaluator" >
<MSBuild Projects="ModelEvaluator\ModelEvaluator.csproj"
Targets="Rebuild" >
<Output ItemName="ModelAssemblies" TaskParameter="TargetOutputs"/>
</MSBuild>
<Copy SourceFiles=" [at] (ModelAssemblies)"
DestinationFolder="$(OutputFolder)\ModelEvaluator" />
</Target>

Now my problem is that this one copies only the exe file. It does not
copy the dlls of other projects that the exe depends on and also the
config file. My question is aren't those a part of the TargetOutputs as
well or do I have to include those separately?

I added an Itemgroup section into the target as follows

<ItemGroup>
<ModelAssemblies Include="ModelEvaluator\bin\$(Env)\*.dll" />
<ModelAssemblies Include="ModelEvaluator\bin\$(Env)\*.config" />
</ItemGroup>
This seems to work but I'm not sure if this is the right approach.

Thanks.
Satish [ Mo, 21 April 2008 21:23 ] [ ID #1946525 ]
Microsoft » microsoft.public.dotnet.general » MSBuild TargetOutputs Question.

Vorheriges Thema: Help With Windows XP(SP3) needed.
Nächstes Thema: sharing files in vista?