Question

I am trying to publish my project using MSBuild. I have been searching on the internet but can not forward at this stage. I am using below code

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "C:\Projects\Employee\Employee.csproj"  /p:Configuration=Release /t:rebuild

This line successfully compile and deploy the project. But my web.config file is located under

obj\Release\TransformWebConfig\original

and my dlls located under

obj\Release\Package\PackageTmp

My question is how can I deploy it to a specific folder. Also I could not find organized information on the Internet with all the parameters and tutorials. Do you know where can I find?

Also I am new to MsBuild and Web Deployment. Other stackoverflow answers related to my question is higher level. Could you please explain more clearly?

Was it helpful?

Solution

If you call MS build in the following manner for instance:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe TestApp.csproj /p:Configuration=Release /t:Package

by specifying the target "Package" you command MS to package the website.

It will proceed to build and package your website into an MSDEPLOY package (specific zip file layout).

the output from the sample build is actually very helpful and gives you clues as to where to go next, for example it tells us where it created the file:

 Package "TestApp.zip" is successfully created as single file at the following location:
 file:///C:/TestApp/obj/Release/Package

It also gives us a link to find out more:

To get the instructions on how to deploy the web package please visit the following link:
     http://go.microsoft.com/fwlink/?LinkId=124618

Then it shows you where it created a sample .cmd file for deploying the package

Sample script for deploying this package is generated at the following location:
 C:\TestApp\obj\Release\Package\TestApp.deploy.cmd
 For this sample script, you can change the deploy parameters by changing the following file:
 C:\TestApp\obj\Release\Package\TestApp.SetParameters.xml
Done Building Project "C:\TestApp\TestApp.csproj" (Package target(s)).

this should get you started in creating and executing happy deployments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top