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

1

21

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....

Reggi answered 23/4, 2013 at 18:45 Comment(4)
Should I install a 32 or a 64 bit version of the SDK (assuming build server is a 64 bit itself)?Vernonvernor
I have spent hours trying to figure out why the deployonbuild wasn't firing as part of my msbuild task. This got me going in the right direction. Thanks.Binucleate
I found that by installing the Web Tools 2012.2 update on the build server my DeployOnBuild worked on the server. https://mcmap.net/q/661264/-publish-doesn-39-t-work-from-build-definition-vs2012Doyenne
I suggest you split this into a question and an answer so it doesn't show up as unanswered.Fechter
V
10

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.

Vermilion answered 9/4, 2014 at 19:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.