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

后端 未结 3 502
孤街浪徒
孤街浪徒 2020-12-08 16:49

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

相关标签:
3条回答
  • 2020-12-08 17:30

    This is just a workaround.

    In the build script for publishing Web sites, after running MSBuild on the Web project itself to publish it (Targets="ResolveReferences;_CopyWebApplication"), I added a copy operation:

    <Copy SourceFiles="@(ProjectBinFiles)" DestinationFolder="$(StageBin)\%(ProjectBinFiles.RecursiveDir)" />
    

    where ProjectBinFiles is an Item representing the files in the bin directory in the source directory, and StageBin is a Property representing the bin folder in the published site's directory. So far, it seems to work.

    0 讨论(0)
  • 2020-12-08 17:34

    I had this same issue in VS 2012 and eventually fixed it by doing the following to any files which needed to be copied:

    • Set the Copy to Output file property to Copy if newer
    • Set the Build Action file property to Content (or Compile if the file needs to be compiled)
    0 讨论(0)
  • 2020-12-08 17:37

    I was having a similar issue as well. I think the answer is using MSDeploy. Investigating it now, but may provide functionality required...

    0 讨论(0)
提交回复
热议问题