Trying to add Visual Studio 2022 to the option list for a visual studio build task in a build pipeline. So far this is not working. We want to build projects using .NET Framework 4.8.1 using build pipelines.
I see that there is a way to manually download a newer agent version from github, but I'm not sure this is the best path. Is there a way to install that into DevOps so that future agents will also be the latest version?
Based on your description, you are using the Azure DevOps Server 2019(version: Dev17.M153.3).
the log says it is using Visual Studio 2019 for the task (Latest version is selected)
The default Visual Studio Build task version: 1.151.2. The root cause of the issue is that this task version doesn't support VS2022.
In this case, even if you upgrade the Agent version and read vs17.0 in the agent capacity, it still cannot be used in the VS build task.
To solve this issue, you need to upgrade the VSBuild task to a higher version(e.g. 1.192.3)
Here are the steps:
Step1: Download VSBuildV1.zip (version 1.192.3) and unzip package to the machine where the Azure DevOps Server located.
Step2: Install Node.js and tfx-cli. Command: npm install -g tfx-cli
Step3: Run command below to update the VS Build task version:
tfx build tasks upload -u {CollectionURL} -t {PAT} --task-path {PATH_TO_UPDATED_TASK}
After doing the steps, you will see the vs2022 shows in the dropdown list.
For example:
When you run the Pipeline, it will use the VS2022 in VS Build task.
For more detailed info, you can refer to this ticket: MSBuild@1 task is not updated to support VS2022