title: How to resolve the error: The build tools for WindowsKernelModeDriver10.0 (Platform Toolset = 'WindowsKernelModeDriver10.0') cannot be found
body: <p>I used following pipeline task to build a windows driver project</p>
  <pre><code>- task: MSBuild@1
    inputs:
      solution: '$(Build.SourcesDirectory)/Manager/HubFilter/HubFilter.vcxproj'
      msbuildArchitecture: 'x64'
      platform: 'x64'
      configuration: 'Release'
  </code></pre>
  <p>Here is the error:</p>
  <pre><code>&quot;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe&quot; &quot;C:\agent\_work\3\s\Manager\HubFilter\HubFilter.vcxproj&quot; /nologo /nr:false /dl:CentralLogger,&quot;C:\agent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.208.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll&quot;;&quot;RootDetailId=|SolutionDir=C:\agent\_work\3\s\Manager\HubFilter|enableOrphanedProjectsLogs=true&quot;*ForwardingLogger,&quot;C:\agent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.208.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll&quot;  /p:platform=&quot;x64&quot; /p:configuration=&quot;Win7_Release&quot; /p:_MSDeployUserAgent=&quot;VSTS_c9d6ee57-7704-47af-9a94-39e083fbb1d9_build_15053_0&quot;
  Build started 9/19/2022 10:56:44 AM.
  ##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): Error MSB8020: The build tools for WindowsKernelModeDriver10.0 (Platform Toolset = 'WindowsKernelModeDriver10.0') cannot be found. To build using the WindowsKernelModeDriver10.0 build tools, please install WindowsKernelModeDriver10.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 &quot;Retarget solution&quot;.
  Project &quot;C:\agent\_work\3\s\Manager\HubFilter\HubFilter.vcxproj&quot; 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 WindowsKernelModeDriver10.0 (Platform Toolset = 'WindowsKernelModeDriver10.0') cannot be found. To build using the WindowsKernelModeDriver10.0 build tools, please install WindowsKernelModeDriver10.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 &quot;Retarget solution&quot;. [C:\agent\_work\3\s\Manager\HubFilter\HubFilter.vcxproj]
  Done Building Project &quot;C:\agent\_work\3\s\Manager\HubFilter\HubFilter.vcxproj&quot; (default targets) -- FAILED.
  
  Build FAILED.
  </code></pre>
  <p>Then I use following task to install WDK 10.</p>
  <pre><code>https://community.chocolatey.org/packages/windowsdriverkit10
  https://community.chocolatey.org/packages/windowsdriverkit11
  
  displayName: 'Install the win 10.0 WDK'
    inputs:
    targetType: 'inline'
    script: |
    choco install windowsdriverkit11
  </code></pre>
  <p>The installation was a success but it did not resolve the error. The VS installed in the agent is VS2022, so should I install the latest WDK(10.0.22621.382) for VS2022, or is there any solution for this error? thanks.
  <a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk#download-icon-step-3-install-windows-11-version-22h2-wdk" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk#download-icon-step-3-install-windows-11-version-22h2-wdk</a></p>