tags:

views:

166

answers:

1

Hi!

I wonder how to solve the following task:

I build additional files in the AfterCompile Target in an MSBuild File. The Post Build Files should be copied somewhere, so that they are put to BinariesRoot automatically on TFS later on.

The Post Build files references obj/Release/some.dll, so it must happen after some.dll was compiled, but before the files get copied to the output directory BinariesRoot.

Can I add them to the Target "CopyFilesToOutputDirectory" somehow?

Any idea?

Thanks, Marco

+1  A: 

I have found out that $(BinariesRoot) is available during the build of a csproj.

So I copy my additional binaries in the csproj AfterCompile Target with:

<ItemGroup>
  <FilesToCopy Include="$(OutputPath)\*.d3cpkg"/>
</ItemGroup>

<Copy
    SourceFiles="@(FilesToCopy)"
    DestinationFolder="$(BinariesRoot)" Condition="'$(BinariesRoot)' != ''" />
Marco Wlotzka
@Marco good thing you got it to work - i confess i was confused that you claimed you couldn't use $(BinariesRoot) within your csproj. I suggest you accept your own answer and i'll dump mine.
Filburt