Missing last version 2019 of visual studio on TFS build configuration [duplicate] - visual-studio

This question already has an answer here:
Team Foundation Server 2018 Build agent Capabilities VS 2019
(1 answer)
Closed 3 years ago.
In the configuration of build step in my TFS server (Version 16.131.27701.1), the version 2019 of visual studio is missing.
This version is installed on my build agents.
How to add this version in the select list of the msbuild step ?

VS2019 is not yet fully supported in vNext Build on tfs2018/2017.
Please first upgrade your build agent version to latest. As you can see in this link System Capabilities do not support VS2019 with prior build agent version.
Then you can try follow to jessehouwing's suggestion to install a newer version task. Details refer this question: Missing last version 2019 of visual studio on TFS build configuration
CAUTION this may cause issues when upgrading to another server version at a later stage, may require newer versions of the Azure Pipelines Agent and can put you in an unsupported state.
You can clone the Azure Pipelines Tasks repo, build it locally and then use tfx-cli to upgrade the built-in tasks in your server.
git clone https://github.com/Microsoft/azure-pipelines-tasks.git
cd azure-pipelines-tasks
npm install
npm run-script build --task MSBuildV1
npm run-script build --task VstestV2
npm run-script build --task VSBuildV1
npm install tfx-cli#latest -g
tfx build tasks upload --task-path .\MSBuildV2 --service-url {{https://server/tfs/collection}}
tfx build tasks upload --task-path .\VsTestV2 --service-url {{https://server/tfs/collection}}
tfx build tasks upload --task-path .\VsBuildV1 --service-url {{https://server/tfs/collection}}
Repeat for every Project Collection on your server.
Another workaround is using MSBuild task instead of Visual Studio Build Step, then specify the location of MSBuild 16.0, it should be:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
Please take a look at this similar question: Team Foundation Server 2018 Build agent Capabilities VS 2019

I am on TFS 2017.3.
After installing VS2019 on one of my build servers and looking at the build agent capabilities I do not see VS2019 listed. I'm betting that you need to have Azure DevOps server installed in order to use it.

Related

How to build .vdproj in Azure DevOps pipeline

I am using windows self hosted agent with VS 2019 build tools installed. But in the build pipeline, I am unable to build ".vdproj" (.net framework 3.5) project. Please let me know whether installing of visual studio is the only option or any alternative approach available.
Thanks.
To build the .vdproj project, you will have to use devenv command to build the project.
Devenv.exe is the central Integrated Development Environment (IDE) for Visual Studio.
So you need to install the Visual Studio to get the Devenv.exe to build the project.
In Azure DevOps, you can add the Command Line Task and run the following command to build the .vdproj project.
For example:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe" MyProjectDir\MySolution.sln /Rebuild Release

Azure Pipelines setup issues with .NET5 Specflow NUnit Project

Having an issue setting up an Azure Pipeline with my .Net5 Specflow NUnit project.
Those the list off jobs I currently have set up however as you can see I am getting an error in the build:
##[error]C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1005: Assets file 'D:\a\1\s\obj\project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project.
I have checked my project file and the reference to net5.0 is in there.
It looks like that you didn't install the .NET 5 SDK on the build agents. You can use the .NET core task (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops) to install it on your agent.
You should also update the NuGet client you are using in your pipeline. 4.4.1 is really old.

Visual Studio Build Not Deploying Upon Build

I am trying to do a Visual Studio Build on TFS 2017. So far, it seems to do the build, but will not do the standard Publish/Deploy I am used to on my local file system, with the Precompiled WCF app, etc. This is what I have so far attached as images, and the PublishProfile I have switched to in desperation. They have VS 2017 installed on the build server, and have updated the MS Build to the latest version. Please help! :)
Visual Studio Build
VM Deploy XML
Check the build log to see whether the deployment executed.
Run the MSBuild command locally on the build agent machine to see whether it works.
Try the following arguments:
/p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\\" /p:DeployDefaultTarget=WebPublish

Xamarin vstool build cannot find NuGet MSBuild targets

Background
I recently converted my Xamarin.Forms app from PCL to Net Standard format.
All of my projects now use PackageReference in the csproj file. Which means no more package.config or package.json.
We use TFS 2015 to build, sign, package our .ipa and .apk files. After conversion, the default MSBUILD build steps do not work as they look for mdtool and the new Visual Studio has vstool instead. So, I updated the build steps to use new tools via command line.
All my projects are NetStandard now (including iOS and Android).
Issue
I can successfully restore NuGet packages using restore MySolution.sln -force on Mac build server. But when I run vstool build MySolution.sln after that, I get this error:
error: NuGet packages need to be restored before building. NuGet
MSBuild targets are missing and are needed for building. The NuGet
MSBuild targets are generated when the NuGet packages are restored.
I am able to successfully run the nuget restore and vstool build locally on the build machine. But only when TFS runs the command via agent, it shows that error message.
Setup
Builds: TFS 2015 on Mac agent running Visual Studio 7.5
According to the error and your description, you need also check if your build agent has corresponding capability to support vsbuild.
Take a look at this related question MacOS - Visual Studio Support and give a try with this workaround:
As a work around we set the Xamarin.iOS variable manually in the build
agent and changed the mdtool path in the Xamarin iOS Build step to
"/Applications/Visual Studio.app/Contents/MacOS/vstool".
Besides you could also try to use the suggestion from Matt in the comment above.
Ok. I was finally able to get a successful iOS build on Mac server. This is the setup that works,
Using PackageReference in iOS .csproj
No package.config, project.json, or AssemblyInfo.cs file.
Running nuget restore .sln before building the iOS project.
Build solution using <path-to-vstool>\vstool build .sln -c:<configuration>
Now, I am working on the Windows machine for Android setup. Once I have that working, I will post my findings here.

What do I need to install a Visual Studio 2010 (sln)-compatible Build Agent in TeamCity?

I seem to be unable to install a build agent on our TeamCity 5.1.2 build server that is compatible with a VS2010 (sln) build configuration.
Under "Build Runners", the following runners are listed:
Ant: Runner for Ant build.xml files
Duplicates finder (.NET): C# and VB duplicate code finder
Command Line: Simple command execution
And under "Compatible configurations", the project I've configured to build with the Visual Studio 2010 (sln) build runner is listed under "Incompatible configurations".
To install the build agent, I'm simply running the .msi installation package, but it seems the default settings are not good enough. The build server machine has Visual Web Developer Express 2010 as well as .NET versions 2.0-4.0 installed, but no full version of VS. Do I need anything more?
(I have no experience whatsoever of building with msbuild scripts, so if I can I want to avoid having to do that.)
I think I figured it out:
Install the Windows SDK from Microsoft. Right now, the latest version is 7.1.
Note that since I just suddenly noticed that it worked, I don't know for certain that this is what did it - it might me completely irrelevant, but this is the only thing in my configuration I changed that I think could be relevant.
TeamCity build agent does not detect .NET 4.0 Client Profile as dotNetFramework4.0. Check you have full .NET Framework 4.0 installed.
Another reason of that is build agent has corrupted plugins. To fix it:
- stop agent
- remove /plugins, /system, /tools folders
- start agent
- wait till agent autoupgrade (agent service may be shown as stopped, just wait)

Resources