0

I've tried using MSBuild with a .csproj file to copy in VS 2013, but can you tell if I'm missing something important? I just did a test with the location of the destination, but nothing shows up when I choose "Build Solution," I don't see any changes in my Documents folder.

<PropertyGroup>
    <SourceDir>C:\Users\{my username}\Source\Workspaces\Builds</SourceDir>
    <DestDir>C:\Users\{my username}\Documents</DestDir>
</PropertyGroup>
<ItemGroup> 
    <AllFolderFiles Include="$(SourceDir)\**\*.*" />
</ItemGroup>
<Target Name="BeforeBuild">
   <Copy SourceFiles="@(AllFolderFiles)" DestinationFiles="@(AllFolderFiles -> $(DestDir)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
m00nbeam360
  • 1,357
  • 2
  • 21
  • 36
  • possible duplicate of [What happened to BeforeBuild and other targets in VS2012?](http://stackoverflow.com/questions/13727351/what-happened-to-beforebuild-and-other-targets-in-vs2012) – stijn Jan 23 '14 at 08:35

1 Answers1

0

I agree with stinj (comment to the original question)

If you put in some simple messages, you can see if the Target fires at all. Also, some code to list out the files in @(AllFolderFiles)

<Target Name="MyBeforeBuild">


    <Message Text="   MyBeforeBuild Start"/>

    <Message Text="List of files using special characters (carriage return)"/>
    <Message Text="@(AllFolderFiles->'&quot;%(fullpath)&quot;' , '%0D%0A')"/>
    <Message Text="   "/>
    <Message Text="   "/>




   <Copy SourceFiles="@(AllFolderFiles)" DestinationFiles="@(AllFolderFiles -> $(DestDir)\%(RecursiveDir)%(Filename)%(Extension)')" />


    <Message Text="   MyBeforeBuild End"/>
</Target>
granadaCoder
  • 26,328
  • 10
  • 113
  • 146