title: MSBuild target _CopyWebApplication does not copy all necessary files to the bin folder
body: <p>Elsewhere on the Web, you can find recommendations on using something like this to simulate the Publish feature in the VS 2005-2008 IDE from a command-line (I hope I did not goof up the syntax!):</p>
  
  <pre><code>msbuild /t:ResolveReferences;_CopyWebApplication /p:BuildingProject=true;OutDir=C:\inetpub\wwwroot\ blah.csproj
  </code></pre>
  
  <p>Now, it looks like the .dll's copy fine.  However, there are certain configuration files and template files that are copied to the bin folder which are needed for the app to work.  For example, an NHibernate configuration file shows up in blah.csproj as:</p>
  
  <pre><code>&lt;None Include="blah.cfg.xml"&gt;
    &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
  &lt;/None&gt;
  </code></pre>
  
  <p>While using Publish from within the IDE copies this file as it should, the aforementioned _CopyWebApplication target does not.  I need this file to be copied in the build script.  Is this desired behavior for _CopyWebApplication?  Any recommendations on how to fix this?</p>
  
  <p>EDIT 4/21/2010:</p>
  
  <p>Let me clarify that we are limited (for now) to VS 2005 and VS 2008 projects, and that our build scripts are written for MSBuild 3.x.  We are not yet ready to move to VS 2010.</p>
  
  <p>Let me also specify that we are looking for a solution available from within a command line so that we can automate a Publish-like command along with custom build options, and possibly automate deployments down the road.</p>