4

I´ve tried to queue a new build on a new Agent, but it failed with this message:

Visual Studio version '15.0' not found. Looking for the latest version.

I´ve already done these steps:

  • Remove and reinstall Visual Studio 2017 and Build Tools
  • Remove and create a new Agent (Downloaded here)

The thing is: On a different server, it works just fine with the same settings (but that´s not the answer...). So I have one definition on the same TFS but different Build Server. On both servers are Visual Studio 2017, Buildtools and an Agent installed.

Is there anywhere a setting I´ve missed?

Community
  • 1
  • 1
Tobias R.
  • 47
  • 1
  • 7

2 Answers2

3

First suggest you to manually run the build on the build agent server with VS. This will narrow if the issue is related to your build agent environment or TFS server side.

If it works on a different build server with the same build definition. Highly doubt it's related to your environment on the specific build sever, double check it.

If you are not working on the latest TFS 2017 update 2 version, you could also upgrade your TFS version, which may do the trick. Take a look at this similar question with same error: TFS 2017 - Build Server does not build Visual Studio 2017

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • 1
    When I upgraded Visual Studio on our build server to 15.3.5, our builds started using msbuild 14.0 and failed because certain language features resulted in syntax errors. I noticed that the MSBuild_15.0 (and others) capability was removed from the agent. The "latest" MSBuild capability pointed to 14.0. I've uninstalled and reinstalled Visual Studio, but the capabilities have not been registered. I can open the solution in Visual Studio on the build server and build the projects just fine. Have you seen this before? It seems like a bug in the Visual Studio installation process... – KellySandwiches Sep 21 '17 at 03:57
  • 2
    I resolved this problem after upgrading to TFS 2017 Update 2 and upgrading the agents. After upgrading the agents, the capabilities were recognized and my builds used the VS 15 tooling (i.e. MSBuild 15.0) – KellySandwiches Sep 21 '17 at 17:40
0

In the build task make sure you've specified the correct MSBuild Version.

enter image description here

In some cases, specifying available MSBuild Version isn't enough, in which case you can specify the location of the right version of MSBuild.exe manually.

enter image description here

chaosifier
  • 2,666
  • 25
  • 39