Looking to evaluate VS2015, we wish to install it side-by-side with VS2013 on a build PC. Our builds are run using Team Foundation Build and I can't see how a build will decide what version of VS to use when building a given solution. Is it tied to the version of Team Foundation Server being used, or perhaps the newest version will be used by default?
This is only for a quick test to see what happens when we try build our codebase under 2015, we're investigating rather than porting at this time. I'm not really familiar with how VS/TFS/TFSBuild versions fit together.
By default, it tied to the version of Team Foundation Server being used. That is, by default TFS 2015 uses VS2015, while TFS2013 uses VS2013.
However, it is allowed to change use another version Visual Studio. It can be achieved via customizing the TFS build process template. Find the Run MSBuild for Project build activity, and set the ToolPath property. The following screenshot shows TFS uses VS2015 during the build process.
You can specify which version of msbuild/visual studio to use from the command line. I do this in some of my builds via the MSBuild Arguments section in the Process tab. Here is an example of what I set it to if I want it to use Visual Studio 2013:
Also here is another SO post that might help you with the specifics of your question above.
How to launch correct version of Msbuild
What worked for me was to run the build from an older VS version command window like:
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\MSBuild Command Prompt"