Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to publish my WCF Service Library using MSBuild Command Line in VS 2012?

I want to Publish my WCF Service Library using MSBuild Command Line with VS2012, i don't want to do right click->Publish Website , instead i want to publish it using Command Prompt(MSBuild).

What are the Pre-requisites required for MSBuild?

I don't have windows azure,it is necessary to install windows azure?

I am new to MSBuild, and I would like step by step instructions on how to accomplish this?

I want the .svc file, all the dll's inside the bin folder and web config file to be present inside the published folder.

like image 476
Lokesh Avatar asked Oct 04 '22 01:10

Lokesh


2 Answers

I found the answer for my question with the reference as below link, "http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/command-line-deployment" using the command line "msbuild C:\ContosoUniversity\ContosoUniversity.sln /p:DeployOnBuild=true /p:PublishProfile=Test"

like image 137
Lokesh Avatar answered Oct 13 '22 10:10

Lokesh


Your solution is fine and will work to deploy directly out to your host (don't forget to include your build Configuration so it publishes the correct config transform).

Another option is to "publish" your site to a local folder and then upload it to your host separately. This also gives you a chance to archive the site in a zip, do post checks and troubleshoot.

You can do this like so:

<MSBuild Projects="WebProject.csproj"
   Targets="Rebuild;_WPPCopyWebApplication"
   Properties="WebProjectOutputDir=WebProject\;UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False;" />

If you get stuck there are more details on publishing WCF, ASP.NET and MVC projects.

like image 30
Andrew dh Avatar answered Oct 13 '22 09:10

Andrew dh