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