title: Why doesn't MSBuild copy as I would expect
body: <p>I'm needing to script my build. I'm using MSBUILD because of it's integration with VS.net.  I am trying to copy some files from the build environment to the deployment folder. I'm using the copy task of MSBuild. But instead of copying the directory tree as I would expect. it copies all the contents into a single folder. I repeat all the files from the directory tree end up in one folder. I need it to copy the tree of folders and directories into the destination folder. Is there something I'm missing?</p>
  
  <p>Here is the relavant parts of my build script:</p>
  
  <pre><code>&lt;PropertyGroup&gt;
      &lt;TargetFrameworkVersion&gt;v2.0&lt;/TargetFrameworkVersion&gt;
      &lt;Source&gt;outputfolder&lt;/Source&gt;
      &lt;DestEnv&gt;x&lt;/DestEnv&gt;
      &lt;DeployPath&gt;\\networkpath\$(DestEnv)&lt;/DeployPath&gt;
  &lt;/PropertyGroup&gt;
  &lt;ItemGroup&gt;
      &lt;TargetDir Include="$(DeployPath)\**\*" Exclude="**\web.config"&gt;&lt;/TargetDir&gt;
      &lt;SourceDir Include="$(Source)\**\*" /&gt;
  &lt;/ItemGroup&gt;    
  &lt;Target Name="Clean" &gt;
      &lt;!-- clean detail ... --&gt;
  &lt;/Target&gt;
  &lt;Target Name="migrate" DependsOnTargets="Clean"&gt;
      &lt;Copy DestinationFolder="$(DeployPath)" SourceFiles="@(SourceDir)" /&gt;
  &lt;/Target&gt;
  </code></pre>