title: VS postbuild event destroys DLL
body: <p>I have a somehow strange problem.
  I have a VS2010 C++ solution for two DLLs and a different solution for the application, which uses the two DLLs. Up to now on changes to the DLLs you had to copy them by hand to the appropriate directory of the application.</p>
  
  <p>I introduced now a post build event to copy the changed DLLs automatically on each build.</p>
  
  <pre><code>copy $(TargetDir)$(TargetName).lib ..\..\lib\AppDir\$(TargetName).lib
  copy $(TargetPath) ..\..\AppBinDir\$(TargetFileName)
  copy $(TargetDir)$(TargetName).pdb ..\..\AppBinDir\$(TargetFileName)
  </code></pre>
  
  <p>When I try to launch the application after a build of the DLLs I get an "Invalid Image" error and the explanation that something might not be suited for Windows. If I open the DLL with DependencyWalker I get the error "No DOS or PE signature found".</p>
  
  <p>If I copy the DLLs manually, everything works fine. So I assume there's a problem with the copy operation in the post build.</p>