Okay this is a fantastic bug. I have a 2012 solution that executes MSBuild on a 2012 TFS server. The parameters passed to the "MSBuild Arguments" field in build process template are as follows:
/p:DeployOnBuild=true /p:PublishProfile=ProfileForProjectA /p:PublishProfile=ProfileForProjectB /p:VisualStudioVersion=11.0
And the error I get back from TFS is....
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4435): The value for PublishProfile is set to 'ProfileForProjectA', expected to find the file at 'C:\Builds\1\Solution\Solution\Sources\Solution\ProjectB\Properties\PublishProfiles\ProfileForProjectA.pubxml' but it could not be found.
In other words it would appear that the build server expects each publish profile (*.pubxml) to be in each PublishProfiles folder. The publish method for both projects is "File System."
The only thing that solves it for me is adding ProfileForProjectA to the PublishProfiles folder for ProjectB and vice versa, but that doesn't seem like a very elegant solution. Can anyone reproduce this behavior? Does anyone have a more elegant fix? Am I missing something?
Thanks in advance.