Closed rizi closed 2 years ago
@bruzkovsky
Hello @rizi, could you please attach full debug logs of your execution of visual studio build task?
Hello @rizi, could you please attach full debug logs of your execution of visual studio build task?
@tatyana-kostromskaya
I think at least two ps1 scripts(maybe more) need to be changed to support VS 2022 (17.x): https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Misc/layoutbin/powershell/Add-VisualStudioCapabilities.ps1
Could you please tell me how to get a full log. Do I have to set a special variable for a full log or something else? Br
To get debug log, you need to run your pipeline with variable system.debug = true.
I think at least two ps1 scripts(maybe more) need to be changed to support VS 2022 (17.x): https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Misc/layoutbin/powershell/Add-VisualStudioCapabilities.ps1
Yes, we need to additionally change these scripts to have correct list of capabilities, but VisualStudio capabilities should not affect "VisualStudio build task" because it contains its own logic to get latest installed versions of VS and msbuild.
To get debug log, you need to run your pipeline with variable system.debug = true.
I think at least two ps1 scripts(maybe more) need to be changed to support VS 2022 (17.x): https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Misc/layoutbin/powershell/Add-VisualStudioCapabilities.ps1
Yes, we need to additionally change these scripts to have correct list of capabilities, but VisualStudio capabilities should not affect "VisualStudio build task" because it contains its own logic to get latest installed versions of VS and msbuild.
@tatyana-kostromskaya here we go: https://drive.google.com/file/d/1wOIU0hDsHDCqoK3skSDMJGOLBSCeDS1V/view?usp=sharing -->I uploaded the log to my google drive as well, just to be sure ;)
I would also expect to see Visual Studio 2022 in the drop down box (Visual Studio Versions), see the attached picture.
I think the tasks on the azure devops server (on premises) need to be updated as well, have a look at this issue (https://github.com/microsoft/azure-pipelines-tasks/issues/15051#issuecomment-945600008), but it seems this has only be done for azure devops services and not for the on premises version, what do you think (as I already mentioned, all tasks are affected (build, restore, test, ..)?
Thx for your time an patience!
For on-premise solutions (Azure DevOps Server) tasks updates are deployed with Azure DevOps Server updates, that should be updated manually. Unfortunately, releases of Azure DevOps Server may not contain latest versions of tasks.
I can only suggest you to update all tasks you are interested in manually. I can provide you ready build of tasks and instructions how to update these tasks in your organization.
For on-premise solutions (Azure DevOps Server) tasks updates are deployed with Azure DevOps Server updates, that should be updated manually. Unfortunately, releases of Azure DevOps Server may not contain latest versions of tasks.
I can only suggest you to update all tasks you are interested in manually. I can provide you ready build of tasks and instructions how to update these tasks in your organization.
@tatyana-kostromskaya Yes, please tell me how to update the tasks and where I can find them, so I can download and install them on our on premises server.
Do I need a new version of azure-pipelines-agent as well, or just the tasks you will provide to me?
Br
Do I need a new version of azure-pipelines-agent as well, or just the tasks you will provide to me?
No, to get new versions of tasks worked you will need just to publish these tasks to your organization. To get correct list of capabilities you will need a new version of agent, but it will be released in a several weeks.
@rizi which tasks do you interested in?
Do I need a new version of azure-pipelines-agent as well, or just the tasks you will provide to me?
No, to get new versions of tasks worked you will need just to publish these tasks to your organization. To get correct list of capabilities you will need a new version of agent, but it will be released in a several weeks.
@rizi which tasks do you interested in?
@tatyana-kostromskaya VsBuild, MsBuild,MsTestV2, please also provide me how to do update the tasks correctly.
One more question: what are the capabilities for the build agents used for? When do I need to update the build agents and when do I need to update the build tasks?
Br
One more question: what are the capabilities for the build agents used for? When do I need to update the build agents and when do I need to update the build tasks?
List of capabilities of agents are mostly used to create demands for running pipelines by users, and as far as I know usually tasks don't relay on capabilities. Mostly to get new features and options in tasks you need to update tasks (or update your Azure DevOps Server, but new feature may appear there with some delay). Every release of agent have new fixes for bugs and/or new features. You can find details about each release on releases page. So if you don't need any of new features or bug fixes you don't have to update them manually, you can just wait for new release of Azure DevOps server and update it.
MsTestV2
Didn't you mean VsTestV2?
please also provide me how to do update the tasks correctly.
Here are zip achieves with latest versions of the tasks: MSBuildV1.zip VSBuildV1.zip VsTestV2.zip
To update these tasks in your organization please follow the instruction:
tfx build tasks upload -u https://<YOUR_ORGANISATION>.visualstudio.com/DefaultCollection -t <YOUR_PERSONAL_ACCESS_TOKEN> --task-path <PATH_TO_UPDATED_TASK>
PATH_TO_UPDATED_TASK - path to folder of unpacked taskIn future you can build these tasks by your self. These tasks are stored in the public repo: https://github.com/microsoft/azure-pipelines-tasks Here you can find instruction with prerequisites and commands for building these tasks: https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/contribute.md#prerequisites-node-and-npm
In future you can build these tasks by your self. These tasks are stored in the public repo: https://github.com/microsoft/azure-pipelines-tasks Here you can find instruction with prerequisites and commands for building these tasks: https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/contribute.md#prerequisites-node-and-npm
Thank you very much.
Do I need a new version of azure-pipelines-agent as well, or just the tasks you will provide to me?
No, to get new versions of tasks worked you will need just to publish these tasks to your organization. To get correct list of capabilities you will need a new version of agent, but it will be released in a several weeks.
@rizi which tasks do you interested in?
Hi, do you have the timeline of when the new tasks will be installed to existing devops orgs?
Regards,
Thibault
PS: I newly installed a new v2.194.0-agent with the newly released Visual Studio Enterprise 2022 and the agent did not detect capabilities for MSBuild, VSTest and VisualStudio
PPS: Sorry just found #3569 , will follow there. But let us know if you have any timeline.
I've blogged a few alternatives to self-building the tasks including an option to download them straight from an active Azure DevOps organization:
https://jessehouwing.net/adding-visual-studio-2022-to-azure-devops-server-2020/
$tasksToDownload = @("VSBuild", "VsTest", "VsTestPlatformToolInstaller",
"MSBuild", "DotNetCoreInstaller", "DotNetCoreCLI")
$org = "<<insert source org>>"
$pat = "<<insert PAT | Agent Pool (Manage)>>"
$projectCollectionUri = "https://yourtfs/yourcollection"
$url = "https://dev.azure.com/$org"
$header = @{authorization = "Basic $([Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(".:$pat")))"}
$tasks = Invoke-RestMethod -Uri "$url/_apis/distributedtask/tasks" -Method Get -ContentType "application/json" -Headers $header | ConvertFrom-Json -AsHashtable
foreach ($taskName in $tasksToDownload)
{
$taskMetadatas = $tasks.value | ?{ $_.name -ieq $taskName }
foreach ($taskMetadata in $taskMetadatas)
{
$taskid = $taskMetadata.id
$taskversion = "$($taskMetadata.version.major).$($taskMetadata.version.minor).$($taskMetadata.version.patch)"
$taskZip = "$taskName.$taskid.$taskversion.zip"
Invoke-WebRequest -Uri "$url/_apis/distributedtask/tasks/$taskid/$taskversion" -OutFile $taskZip -Headers $header
& tfx build tasks upload --task-zip-path "$taskZip" --service-url $projectCollectionUri
}
}
Agent Version and Platform
2.193.1, I downloaded this version from your github repository and installed it on our self hosted (on premises) azure devops server (17.143.28621.4 (AzureDevOps2019) on windows.
Visual Studio 2022 Enterprise RC has been installed before I installed the new agent.
We are using "classic builds" (not yaml builds) and all tasks (like visual studio build task or visual studio test task) still using VS 2019 instead of VS 2022.
We are selected 'latest version' in the visual studio build task, but that does not have any effect.
Settings --> Agent pools --> Default --> I see the new installed agent (2.193.1), but under capabilities it still only shows VS 2019 and MSBuild 16.
I would expected that under capabilities VS 2022 and MSBuild 17 should be listed as well?
Can you point me in the right direction to make our azure devops server/pipeline agent use VS 2022 instead of VS 2019?
This seems to be related: https://github.com/microsoft/azure-pipelines-tasks/issues/15051#issuecomment-945600008
br