views:

1278

answers:

3

How can I publish a web app using msbuild through the command line or insdie a batchfile??

+1  A: 

What you're talking about is called a Web Deployment and you can find information about how to do that here:

http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx

Gavin Miller
+3  A: 

I wonder what exactly you're trying to do. Is it just xcopying your files over to the deployment server or does it also include setting up IIS?

MSBuild has built in tasks for Copy and Building, but does not include IIS tasks. For that I would recommend finding a tasks library like the MSBuild extension pack or the MSBuild community tasks.

http://www.codeplex.com/MSBuildExtensionPack/

http://msbuildtasks.tigris.org/

Min
+1 - msbuildtasks is a great library and easy to use
Gavin Miller
+1  A: 

If this is a web application project all you need to to is build the sln/project and then copy the published web site files to wherever

If it is a web site then you can use the ASPNetCompiler task

<AspNetCompiler
      Clean="true"
      Debug="true"
      VirtualPath="/"
      PhysicalPath="$(BuildDir)\"
      TargetPath="$(BuildDir)\Publish\"
      Updateable="true"
      FixedNames="true"
      Force="true" />
Dean
Dean, how do I add a web app project to a website where web app is on same server as website and I'm not trying to do an automated deployment? Just a simple web hosting using IIS6 on a Windows XP system?
salvationishere