People using TFS 2012 have reported success using:
/tv:14.0 /p:GenerateBuildInfoConfigFile=false /p:VisualStudioVersion=14.0
as arguments to MSBuild. Perhaps this might work for you, but so far this does not work for my TFS 2013 build agents.
Update:
I finally got this to work on TFS 2013. Here is what I had to do:
- Install VS 2015 or Microsoft Build Tools 2015 (I have both).
- Edit my build to use a build process template called TfvcTemplate.12.xaml. I guess that any template newer than this one will do, but the DefaultTemplate.11.1.xaml definitely won’t work!)
- Set MSBuild arguments to /tv:14.0 I did not have to use the other two I mentioned above.