MSBuild target _CopyWebApplication does not copy all necessary files to the bin folder

Posted by apollodude217 on Stack Overflow See other posts from Stack Overflow or by apollodude217
Published on 2010-04-07T16:05:36Z Indexed on 2010/04/10 0:13 UTC
Read the original article Hit count: 1401

Filed under:
|

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!):

msbuild /t:ResolveReferences;_CopyWebApplication /p:BuildingProject=true;OutDir=C:\inetpub\wwwroot\ blah.csproj

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:

<None Include="blah.cfg.xml">
  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

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?

© Stack Overflow or respective owner

Related posts about msbuild

Related posts about publish