Build VS 2015 Solution w/ Unit Tests on TFS 2013 T

2019-07-30 23:42发布

问题:

developers are using VS 2015 now but we don't want to upgrade to TFS 2015 on the server. So trying to have TFS 2013 Update 5 Team Build build our vs 2015 solution w/ unit tests (x64 if that matters).

I tried several things based on other answers (made a new template and changed BuildProcessVersion from 12.0 to 14.0 and added ToolVersion="[14.0]" for RunMSBuild) - but now getting this when I start the team build:

Exception Message: The build controller used for this build does not support the version of the template file used by the build definition. The version of the template file is 14.0. The maximum supported version for this build controller is 12.0.0.0. This build controller must be upgraded to build this version of the template file. (type Exception) Exception Stack Trace: at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext) at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)


References:

TFS Build 2013 - using Visual Studio 2015

Make local TFS build agent to use v14 msbuild tools


thanks in advance.

---- edit 5/1/2016 in tfs 2013 for the default template, there does not appear to be ToolPath property ... I did update the ToolsVersion...

回答1:

OK - /p:VisualStudioVersion=14.0 did not work - I had to add /tv:14.0. So this is what I did: 1. install TFS 2013 & setup build server 2. Install VS 2015 3. Install VS 2013 4. in the team build, use the Default Template (TfvcTemplate.12.xaml) and use /tv:14.0 as MS Build arguments



回答2:

You have to install VS 2015 on the build agent then use /p:VisualStudioVersion=14.0 on your build.