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?

1
  • any final solution with full source code about it? Commented Jun 6, 2012 at 6:27

2 Answers 2

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]

Sign up to request clarification or add additional context in comments.

1 Comment

thx... I'm not exactly sure what to do with that code. Where do I put it?
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

1 Comment

Any solution without robocopy ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.