24

Is there any way to build deployment package for a Web Application using Visual Studio 2010 CommandLine ?

Ange
  • 253
  • 2
  • 6

1 Answers1

26

I think this has what you are looking for

MSBuild "MyProjectName.csproj" /T:Package /P:Configuration=Staging;PackageLocation="D:\Vishal\Package.zip"

I got this from this site: http://vishaljoshi.blogspot.com/2009/02/web-packaging-creating-web-packages.html

Chris Pfohl
  • 18,220
  • 9
  • 68
  • 111
hivie7510
  • 1,246
  • 10
  • 23
  • 3
    If you get the OutputPath empty error, add a /P:Platform=AnyCPU argument (no spaces in AnyCPU). – Luke Puplett Dec 18 '12 at 16:10
  • 5
    Also, the PackageLocation will be cleaned first, so watch for deletion of important files. I spat my coffee across the room when I saw it cleaning my main code folder! – Luke Puplett Dec 18 '12 at 17:20