Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

publish a website using msbuild [duplicate]

Possible Duplicate:
How do I publish a Asp.net web application using MSBuild?

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

like image 229
user62958 Avatar asked Mar 23 '09 17:03

user62958


People also ask

How do I publish with MSBuild?

You can pass /p:PublishUrl="newpath" to the msbuild command. You would also see this set in the csproj file which you can change.

What is publish profile in MSBuild?

A publish profile is just an MSBuild file. When you pass in PublishProfile and DeployOnBuild=true, then the publish profile is Imported into the build/publish process. It will supply the publish properties needed to perform the publish. Let's see how that works.

How do I publish an entire solution in Visual Studio?

To publish from Visual Studio, do the following: Change the solution configuration from Debug to Release on the toolbar to build a Release (rather than a Debug) version of your app. Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish.


2 Answers

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/

like image 135
Min Avatar answered Oct 06 '22 10:10

Min


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" />
like image 30
Dean Avatar answered Oct 06 '22 11:10

Dean