Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 not listed in devops build solution pipeline task

I have an on-prem instance of Azure DevOps 2020.1.1 in the build pipeline I have a build solution task which has visual studio version set to "latest" when building a .NET6 project this fails saying of course .NET6 isn't supported because the latest version it seems to recognize is 2019, 2022 isn't even listed in the visual studio versios drop down.

I have installed visual studio 2022 on the server and the build agents see it (they were updated to the latest agents version).

How do I get the latest visual studio version to show as 2022 in the build solution task? MS hasn't released any updates for the on-prem server for this yet that I know of, is there a way to add it or make it find it?

like image 786
BlueBSH Avatar asked Feb 21 '26 19:02

BlueBSH


2 Answers

The trick is to use a MSBUILD task and switch from Version to Specify Location and insert the path to the msbuild.exe of VS2022 e.g. C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe.

EDIT:

Another way is to use a Command line task and call the executable directly. If you need the complete VS development environment to build your application, than specify the path of the executable in the Tool field for example as "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.com" and specify the solution and configuration in the Arguments field for example as "MySolution.sln /build "Release|Any CPU".

like image 64
Günter Stein Avatar answered Feb 26 '26 11:02

Günter Stein


Look at the screenshot below: enter image description here

Please make sure your path is correct in the MSBuild.exe task

like image 33
qaguru Avatar answered Feb 26 '26 11:02

qaguru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!