On my development laptop, I only have VS2012 RC installed, and I can successfully connect to the new MSDeploy.pubxml plumbing (DeployOnBuild and PublishProfile parameters) from powershell (via psake) to deploy my website on our test server.
However, on my build server, I first installed VS2010 SP1, and now I additionally installed 2012 RC (I have other builds on this computer, still .NET 4).
When I run the same script with exactly the same parameters, I see different results between my dev machine and the build server. The command I run is
exec { msbuild "Website\WebSite.csproj" /mp:DeployOnBuild=True /p:PublishProfile=MyTestProfile }
On the build server, this does not actually run MSDeploy, but simply the packaging bits that fasten the site and create the deployment package. My machine successfully selects the pubxml file and makes a successful deployment.
In the end, I believe that I traced this problem in the Microsoft.Web.Publishing.targets file. On my dev machine, I only have
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
but the server additionally has
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web
and it seems that this file (without knowledge of the .pubxml material) is used there.
Has anyone realized what I need to collapse (preferably in my own msbuild files so that I don't mess up anything on the build server for build 4.0) to get msbuild to get the version of v11.0 file and thereby use my .pubxml file?