user137348
user137348

Reputation: 10332

Copy the content of the bin folder into a specific folder

So far I have this,but it's not working.

  <Target Name="AfterBuild">
        <Copy SourceFiles="bin\" DestinationFolder="C:\temp\appServer\"></Copy>
  </Target>

Upvotes: 2

Views: 4084

Answers (3)

lcranf
lcranf

Reputation: 171

Looks like the MSBuild Copy task doesn't take a directory for SourceFiles, but instead a list of files to copy.

Check out the MSDN article here for a simple example:

MSDN Link

Upvotes: 1

Julien Hoarau
Julien Hoarau

Reputation: 49970

Try this :

<ItemGroup>
    <BinFiles Include="bin\**\*.*"/>
</ItemGroup>

<Target Name="AfterBuild">
    <Copy SourceFiles="@(BinFiles)" 
          DestinationFolder="C:\temp\appServer\"/>
</Target>

Upvotes: 7

Mike Ohlsen
Mike Ohlsen

Reputation: 1900

Try using a file wildcard.

<Target Name="AfterBuild">
     <Copy SourceFiles="bin\*.*" DestinationFolder="C:\temp\appServer\"></Copy>
</Target>

Upvotes: 0

Related Questions