10

I have a Visual Studio 2012 solution, which contains three web projects. Each of them has a web deploy publish profile, which creates a package in a specific directory. The solution itself also has a special Deployment configuration.

Using msbuild, building the solution in a Deployment configuration is easy, but how can I publish the 3 web projects using a specific profile using an msbuild build script/task (rather than invoking command lines)?

Ivan Zlatev
  • 12,516
  • 8
  • 40
  • 49

2 Answers2

12

I think you can try the following:

msbuild.exe MyProject.csproj /p:DeployOnBuild=true;PublishProfile=MyProfile

as pointed by Steve, this post by Sayed Ibrahim Hashimi seems to address your requirement publish from an msbuild in detail.

Community
  • 1
  • 1
Isantipov
  • 17,203
  • 1
  • 24
  • 41
1

Are all three published profiles named the same way? If so, could you just add

/p:PublishProfile=MyProfile to the msbuild command?

See this link for more info

Community
  • 1
  • 1
Steve
  • 196
  • 1
  • 10
  • My question is about publishing from an msbuild script. I assumed there is an msbuild task that can be used, but so far the documentation is very scarce. – Ivan Zlatev Feb 25 '13 at 19:03
  • The documentation is scarce. Have you tried something like this script, though? `msbuild MySolution.sln /t:build /p:PublishProfile=MyProfile` – Steve Feb 25 '13 at 19:13