I am trying to automate my builds/releases. I'm using VS 2013 for development and I put my team project on VSTS (Visual Studio Team Services). I downloaded "Build and Release Agent" and installed a private agent on my machine. Agent connected successfully and listening for jobs as well. But when I am trying to create a build from Visual Studio Online it doesn't build and fails. The error that I am getting is
Error: Visual Studio 2015 is not found. Try again with a version that exists on your build agent machine
Do I need to get Visual Studio 2015? But I don't have a license for that.
VSTS checks the agent to see what capabilities it supports - basically what other dev tools are installed on the agent machine - and it sounds like that's the check that's failing here.
But why not update to Visual Studio 2017, the latest, now? The Community edition is free and quite full featured. I expect you'd be happy going that route.
When you register an agent, Visual Studio Team Services (VSTS) scans the machine to determine which tools are installed and can be used for building software. This can be versions of Visual Studio, Java, NPM etc. This makes up the capabilities of your agent. If you navigate to https://.visualstudio.com/_admin/_AgentPool?poolId=1&_a=agents, you can then select your pool and agent (by default, the pool is default and the agent name is your machine name). You can then view the capabilities of the agent like shown here:
Now when you create a build, each task also has a set of demands. When you queue a build, VSTS looks for an agent that has the right set of capabilities to meet the demands of the build definition. When such an agent cannot be found, you get an error like what you're seeing.
So you've probably added a task that requires VS 2015. Some tasks allow you to specify the VS version you want to use. If that's not possible, you could look into using another task or maybe using one of the free Community Editions to upgrade your machine.
Related
We have a build agent (a self hosted buildserver) which apparently satisfies msbuild, but not visualstudio so we tried to install vs.
I installed vs2022 community on the server and restarted.
Still those mails comes when a change is detected in the repository.
No agent found in pool XXX which satisfies the following demand: visualstudio. All demands: msbuild, visualstudio, Agent.Version -gtVersion 2.192.0
Is community not an option?
Azure DevOps Server 2020 and below only officially supports Visual Studio 2019 and below for the tasks and the agent version it ships with. The latest agent version for Azure DevOps (Service) has the right updated scripts in the Capability Providers.
In case this is on an Azure DevOps Server and want to use Visual Studio 2022 / .NET 6, you need to:
Set a magic environment variable to be able to run a more recent agent version:
AZP_AGENT_DOWNGRADE_DISABLED=true
Upgrade to/Install agent version 2.195.0 or newer.
Install the Visual Studio 2022 compatible Visual Studio and MsBuild tasks into your server. Either by directly overwriting the tasks on the server:
npm install -g tfx-cli
tfx build tasks upload --task-zip-path Task.guid-version.zip --service-url https://yourtfs.com/tfs/DefaultCollection
You can download the latest zip file from my GitHub repo. Or download them yourself with my script.
Or installing them side-by-side as an extension which will give the tasks get a new unique id and a different reference name.
I've laid out the process in this GitHub repo and blogpost:
https://github.com/jessehouwing/azure-pipelines-tasks-zips
https://jessehouwing.net/adding-visual-studio-2022-to-azure-devops-server-2020/
The expectation is that Azure DevOps Server 2022 will be the first version to ship with official support for Visual Studio 2022.
Community is an option (but I did not test 2022). Check agent capabilities.
Currently we only have Visual Studio 2015 installed on our TFS build server. I'd like to put VS 2017 and VS 2019 onto the build server.
Does that mean I need to install all possible workloads for both of them, in the build server?
The best practice is to simulate the build server to the developer machine, so it's good to install all the workloads that installed on the VS in the developer machine.
If you don't want, you can install only Visual Studio Build Tools, it allows you to build VS projects. but sometimes if the developer wrote some specific code in specific workload that build tools not support it, the TFS build will fail.
I am trying to replicate my development environment into my build server in order to debug an error that occurs only in the build server, The same solution is compiled with msbuild that is located in C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe in both machines.
In the development machine, the solution is getting compiled successfully while in the build server it fails.
Reading the outputs from msbuild I noticed that in both machines the build is done with different versions of Microsoft build engine
dev machine: 14.0.25420.1
build server:14.0.23107.0
In order to rule out that this error relates to the version
I tried to pass the msbuild from the dev machine to the build server and ran it there which output the build server version.
How can the same msbuild yield different version on a different machine?
How can I update the build engine?
How can the same msbuild yield different version on a different machine?
According to the official blog MSBuild is now part of Visual Studio!:
Starting with Visual Studio 2013, the 2013 version of MSBuild will
ship as a part of Visual Studio instead of the .NET Framework.
So at this moment, MSBuild.exe have the same version of Visual Studio 2015, you can check the version of Visual Studio 2015:
So update the version of Visual Studio on the build server to have the same version MSBuild.exe.
Update for comment:
Is it possible to update msbuild without installing visual studio?
The answer is yes, you can download the Microsoft Build Tools 2015, install it to update msbuild.exe without installing Visual Studio.
Please refer to the document MSBuild is now part of Visual Studio! for details:
The New Microsoft® Build Tools Package
MSBuild is now a component of Visual Studio and will ship with all
SKUs of Visual Studio, including Team Build so if you use Visual
Studio all of your build needs should be covered. We understand that
there are a great number of reasons that you may want to use MSBuild
and other build tools without needing to install Visual Studio so we
are making the tools available as a new standalone package called
Microsoft® Build Tools. The package includes MSBuild and the VB/C#
compilers. The new package can be acquired here on the MSDN Download
Center.
This standalone package is great for build servers requiring fine
grain control of their build process. With this new approach to
evolving MSBuild, you have more control over build behavior and are
not impacted by .NET Framework versions.
Hope this helps.
How to enable MS Fakes generating in TFS 2017 VS Build Test-step without installation of Visual Studio on build server?
I know there is a way by copying some files from developer machine to the build Server but it doesn't seem right.
There is also "VS Build Tools 2017" that distributes some targets and references for build process without full VS stand alone installed, but it still doesn't include Fakes support!
Is there any package for that so I could install it without silly per file copying, wihtout VS and my own licence on server?
Afraid there is no way to bypass this, you have to install visual studio and need an Enterprise edition , unfortunately.
Have a look at this article in the Test section: https://www.visualstudio.com/vs/compare/ . If you could simply add some free packages, there is no need to restrict users only use visual studio enterprise edition for Microsoft Fakes (Unit Test Isolation) support.
We're running TeamCity 9.0.3 and have had Visual Studio 2010, 2012 & 2013 full install on our build server for years now.
I know for a fact that we need certain Visual Studio targets in order to deploy our applications but I'm convinced we don't need to have a full Visual Studio installation in order to use the Visual Studio (sln) build runner but can't find any documentation to say whether or not we do need it.
Can anyone show me documentation or verify from their own experience whether or not a full Visual Studio install is needed for this build runner to work?
Edit: I have seen this question:
Does MSbuild require Visual Studio to be installed on the build server?
And mine is not the same question, it's a different topic. That question is asking whether or not Visual Studio is needed to as a prerequisite for the MSBuild build runner. My question pertains to the Visual Studio build runner
Roughly speaking, by installing Windows SDKs you get what's required to build applications.
Windows 7 SDK
Windows 8.1 SDK
Windows 10 SDK
Multi targeting packs are also required if you use that.
Starting from Visual Studio 2013, you also need to install the separate MSBuild 2013. And MSBuild 2015.
C++ might require you to install other bits.
So you will have to go through lots of trials. Most people simply give up and install full VS.
You don't need full Visual Studio Installed for running the build, all you need are the build tools.
In the "Step" you create to build your solution, the dropdown allows you to select which version of Microsoft builds you want to use where you can specify whether you use MSBuild12 or the latest MSBuild14 for VS2015 projects.
All you have to do is make sure that you install the required Microsoft Build tools in this instance:
Build tools for 2010, 2012 and 2013. The TC build step should then try detecting this install by default in C:/Program Files (x86)/MS Build/Build Tool Number/MSBuild.exe
Note: You will have to restart your agent after you install these tools on the Agent Machine for TeamCity to detect the tools.
The Visual Studio (sln) build runner requires the proper version of Microsoft Visual Studio installed on the build agent.
Reference: https://confluence.jetbrains.com/pages/viewpage.action?pageId=74847254