Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Visual Studio 2017 with TFS Visual Studio Build Step

I am running TFS 2015 and are using the Visual Studio Build Step. On the developemnt machines I moved to use Visual Studio 2017 so I also want to use Visual Studio 2017 for the TFS builds.

I installed Visual Studio 2017 on the build server and restarted the build agent. However Visual Studio 2017 does not show up in the capabilities of the agent and it also does not show in the list of Visual Studio versions in the build step.

I know I can choose "latest" from the list of Visual Studio version in the build step, but this will still use VS 2015 as the agent does not know that it has VS 2017.

How can I make sure that the Visual Studio Build Step in TFS2015 uses Visual Studio 2017?

like image 508
Marco Avatar asked Mar 09 '17 07:03

Marco


People also ask

How do you connect Visual Studio to TFS?

Visual Studio 2015 Select the Manage Connections button in Team Explorer to open the Connect page. Choose Connect to Team Project to select a different organization, TFS, or project to connect to. Select the projects to work on. If it's your first time connecting, add TFS to the list of recognized servers.

How do I create a TFS project in Visual Studio 2017?

In Visual Studio, on the Team menu, click Connect to Team Foundation Server. If you have already configured a connection to a TFS server, you can omit steps 4-7. In the Connection to Team Project dialog box, click Servers. In the Add/Remove Team Foundation Server dialog box, click Add.

How do you make a build in TFS?

In the TFS web portal, open the desired project. Select Build and Release and then Builds in the Navigation bar. Click the +New button to create a build definition. On the Select your repository page, select the preferred repository type and Continue.


2 Answers

You can use MSBuild task instead of Visual Studio Build Step, then specify the location of MSBuild 15.0:

enter image description here

like image 98
Cece Dong - MSFT Avatar answered Oct 21 '22 06:10

Cece Dong - MSFT


In TFS 2015 the build steps and forward compatibility is only updated when TFS is updated. If you are using TFS 2015.3 already then you will need to move to TFS 2017 to use this out of the box.

The build step ultimately calls out to devenv.exe and the drop down changes the path. You can call out manually to VS 2017...

like image 45
MrHinsh - Martin Hinshelwood Avatar answered Oct 21 '22 05:10

MrHinsh - Martin Hinshelwood