Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Visual Studio 2012 Publishing Profiles on a Build Server with MsBuild without installing Visual Studio 2012

Tags:

I read through many of the posts on here and never found a clear answer that worked. So after spending the time getting this to work, I figured I should post it.

Problem: The publishing profile would build on the server, but would not publish.

Solution:

  1. Make sure you installed Microsoft Windows SDK and .Net Framework 4

  2. From your client machine with Visual Studio 2012 update 2 installed, copy:

\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\Web\
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\WebApplications\

To the same location on your server.

Then make a simple batch file:

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /v:diag YOUPROJECT.sln /p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile=YOURPROFILE

This is working for us on multiple build servers.

I hope this helps someone.

It seems insane to me that Microsoft hasn't provided a MSBuild update with all the publishing options. It seems to me that the command line tools are more important on the server....

like image 262
Dave Avatar asked Apr 23 '13 18:04

Dave


People also ask

Is it is possible to build application if MSBuild is not installed?

Is it possible to build an application on a system if the MSBuild is not installed? If so, How? Yes, it is actually possible because the MSBuild doesn't depend on the Visual Studio of its operations. Users simply need to install the msbuild.exe file for this.

Can I use MSBuild without Visual Studio?

To install MSBuild on a system that doesn't have Visual Studio, go to Build Tools for Visual Studio 2022 on the downloads page. Another way of getting MSBuild is to install the . NET SDK.

What is the difference between MSBuild and Visual Studio build?

Visual Studio determines the build order and calls into MSBuild separately (as needed), all completely under Visual Studio's control. Another difference arises when MSBuild is invoked with a solution file, MSBuild parses the solution file, creates a standard XML input file, evaluates it, and executes it as a project.


1 Answers

Just moving Dave's solution into an answer.

Solution:

  1. Make sure you installed Microsoft Windows SDK and .Net Framework 4

  2. From your client machine with Visual Studio 2012 update 2 installed, copy:

\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\Web\
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\WebApplications\

To the same location on your server.

Then make a simple batch file:

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /v:diag YOUPROJECT.sln /p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile=YOURPROFILE

This is working for us on multiple build servers.

like image 115
ouflak Avatar answered Oct 14 '22 21:10

ouflak