0

I'm trying to publish a .Net web app using Powershell. I want to publish "all files in this project" but it only seems to be publishing "only files needed to run this application". When I publish from Visual Studio 2010 it work fine.

Here's my command:

& msbuild "$WebProjectFile" /verbosity:minimal "/t:ResolveReferences;_CopyWebApplication;publish" /p:Configuration=Release /p:OutDir="$PublishPath\bin\" /p:WebProjectOutputDir="$PublishPath"

Any ideas how I can do this?

Trev
  • 1,358
  • 3
  • 16
  • 28

2 Answers2

2

Some notes since I am not sure exactly what is not working: - CopyLocal set to true for all your references - Add a specific copy files to the your build script

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

Below is a similar question about not all files copying:

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

Not sure if any of this helps.

-Adam

[Edit: trying to undo my edit]

Community
  • 1
  • 1
alistek
  • 401
  • 2
  • 4
0

alistek pointed me in the right direction and I ended up using Robocopy to copy the missing files:

& robocopy "{folder with missing files}" "$PublishPath\{folder to put missing files}" /MIR /NJH /NJS /NFL /NDL

Notes:

  • This worked perfectly for me because all my missing files were from a single directory
  • The /NJH /NJS /NFL /NDL switches are only used to stop Robocopy from spitting its progress to the screen
Trev
  • 1,358
  • 3
  • 16
  • 28