Windows-2022 Agent with WDK does not provision WDK platform toolsets in Visual Studio 2022
plimburg opened this issue · comments
Description
We have successfully run printer driver creation pipelines with Windows-2019 agent and Visual Studio 2019. The pipelines build projects that reference WDK platform toolsets such as WindowsUserModeDriver10.0.
Now migrated to local Visual Studio 2022 and updated WDK. WDK platforms are available, and builds are successful locally.
But, build pipeline run on agent Windows-2022 fails. Error:
"The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found."
I note that WDK docs say WDK Visual Studio extentions might need a separate VSIXinstaller step to install, but that was not the case in our local Visual Studio 2022 and WDK install.
Platforms affected
- Azure DevOps
- GitHub Actions
Virtual environments affected
- Ubuntu 18.04
- Ubuntu 20.04
- Ubuntu 22.04
- macOS 10.15
- macOS 11
- macOS 12
- Windows Server 2019
- Windows Server 2022
Image version and build link
Build started 7/25/2022 4:19:33 PM.
Project "D:\a\1\s\Package\Package.vcxproj" on node 1 (Clean target(s)).
CoreClean:
Creating directory "Release\int".
Project "D:\a\1\s\Package\Package.vcxproj" (1) is building "D:\a\1\s\InfFile\InfFile.vcxproj" (2) on node 1 (Clean target(s)).
CoreClean:
Creating directory "int".
Done Building Project "D:\a\1\s\InfFile\InfFile.vcxproj" (Clean target(s)).
Done Building Project "D:\a\1\s\Package\Package.vcxproj" (Clean target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.63
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe" "D:\a\1\s\Package\Package.vcxproj" /nologo /nr:false /dl:CentralLogger,"D:\a_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.199.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=D:\a\1\s\Package|enableOrphanedProjectsLogs=true"*ForwardingLogger,"D:\a_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.199.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:platform="x64" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_7372a1f7-1b06-424a-9843-4054c7515a72_build_131_0"
Build started 7/25/2022 4:19:35 PM.
##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): Error MSB8020: The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
Project "D:\a\1\s\Package\Package.vcxproj" on node 1 (default targets).
Project "D:\a\1\s\Package\Package.vcxproj" (1) is building "D:\a\1\s\InfFile\InfFile.vcxproj" (2) on node 1 (default targets).
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): error MSB8020: The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\a\1\s\InfFile\InfFile.vcxproj]
Done Building Project "D:\a\1\s\InfFile\InfFile.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\a\1\s\Package\Package.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\a\1\s\Package\Package.vcxproj" (default target) (1) ->
"D:\a\1\s\InfFile\InfFile.vcxproj" (default target) (2) ->
(PrepareForBuild target) ->
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): error MSB8020: The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\a\1\s\InfFile\InfFile.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.27
##[error]Process 'msbuild.exe' exited with code '1'.
Finishing: Build KipV4Win Package (includes InfFile project build)
Is it regression?
sort of. Was OK using pipeline agent Window-2019
Expected behavior
On agent Windows-2022 the Visual Studio WDK extensions should be installed and available to the pipeline.
Actual behavior
Using agent Windows-2022, WDK extensions for Visual Studio 2022 do not seem to be installed. We get error:
"The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found."
Repro steps
Run pipeline on Agent-2022 that runs Visual studio project that uses Platform toolset WindowsUserModeDriver10.0.
I have found this may be same issue as #5897, and will try the fix reported there.
I tried to install WDK.vsix by running Powershell task with inline script as suggested in #5897 :
$FilePath = Resolve-Path "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2022*\WDK.vsix:
Install-VsixExtension -FilePath $FilePath -Name "WDK.vsix" -VSversion "2022" -InstallOnly
Task seems to start OK, but after 10 minutes with no visible progress, I cancelled. How long should this take? Any suggestions for troubleshooting? Here is task output, up to point where I cancelled.
Starting: Add WDK extensions to Visual Studio 2022
==============================================================================
Task : PowerShell
Description : Run a PowerShell script on Linux, macOS, or Windows
Version : 2.200.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
========================== Starting Command Output ===========================
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\c1a7f8f8-9e36-40ef-922f-f39e68b3fa87.ps1'"
Starting Install WDK.vsix...
Thanks for your suggestions.
-Paul
@plimburg, it takes 10-30 minutes.