Bewerken

Delen via


Install the WDK using NuGet

This topic describes how to use NuGet to install the Windows Driver Kit on your computer. NuGet is a popular package manager, used for packaging and distributing software. For more information, see What is NuGet?.

Windows Drivers Kit Overview

Windows Driver Kit (WDK) is a software tool set used to develop, test and deploy Windows drivers. The content included in the WDK can be categorized into five unique types: Headers, Libraries, Samples, Tools and Templates.

The WDK is released in three different distributions, with different installation options.

Windows Driver Kit (WDK): The WDK is available as a traditional msi based package. It requires Visual Studio to be installed and the WDK is installed to %ProgramFiles(x86)%\Windows Kits\. See Download the Windows Driver Kit (WDK) for information on downloading and installing the WDK.

Enterprise Windows Drivers Kit (EWDK): This is shipped as a standalone ISO, which includes the command line compiler build tools, the SDK and the WDK. The EWDK is a standalone self-contained command-line environment. To get started, just mount the ISO and run LaunchBuildEnv. Visit Download the Windows Driver Kit (WDK) for details on how to download and use the EWDK.

Windows Drivers Kit NuGet Package: The WDK NuGet package consists of essential libraries, headers, DLL, tools and metadata used for building Windows drivers that can be shared and supported by modern CI/CD pipelines. The official release of the WDK NuGet package is now available on nuget.org. The latest release version is 10.0.26100.1. For information on the latest release of the WDK, SDK and Visual Studio, see Kit versioning.

Users can access and consume the NuGet packages directly from nuget.org from within Visual Studio. Using NuGet with the WDK provides a lightweight solution for WDK acquisition for developers who need always up to date tools for building modern hardware drivers. For more information, see Install and manage packages in Visual Studio using the NuGet Package Manager.

The WDK NuGet packages are also available on the NuGet website.

x64: https://www.nuget.org/packages/Microsoft.Windows.WDK.x64/

ARM64: https://www.nuget.org/packages/Microsoft.Windows.WDK.ARM64

Directions for building drivers in automated build systems

For directions on building drivers in large automated system, see Building Locally.

Install the latest WDK using NuGet - Step by Step

Prerequisites

  • X64/ARM64 PC with Windows 11 or newer.

Step 1: Install Visual Studio 2022

Download and install Visual Studio 2022 Community, Professional, or Enterprise edition.

Download Visual Studio Tools

During the installation, select and install Desktop development with C++.

Step 2: Prepare Visual Studio

The WDK requires Visual Studio 2022 with the VS 2022 C++ build tools and their corresponding VS 2022 C++ Spectre-mitigated libs (Latest) components for each architecture you intend to build drivers for.

  1. Register and sign in with your credentials to Visual Studio.

  2. Select and install the following VS individual components - MSVC V143 - VS2022 C++ x64/x86 Spectre-mitigated libs (Latest) and MSVC V143 - VS2022 C++ ARM64 Spectre-mitigated libs (Latest)

Step 3: Install WDK Visual Studio extension

Option 1: Visual Studio Marketplace

In Visual Studio, select Extensions, Manage Extensions and then Visual Studio Marketplace. Search for "Windows Driver Kit", select and install the Windows Drivers Kit Visual Studio extension.

screenshot of Visual Studio showing Visual Studio Marketplace extension

Option 2: Download and install

Download and install the Windows Drivers Kit Visual Studio Extension using this link:

Windows Driver Kit - Visual Studio Marketplace

screenshot of Windows Driver Kit Visual Studio extension (VSIX) install dialog

Getting Started - Use the WDK to develop a driver

Follow the following steps to acquire and install WDK NuGet package in Visual Studio.

  1. Launch Visual Studio.

  2. Create a new driver project, for example a "Kernel Mode Driver (KMDF)" C++ project.

  3. Right Click the driver project solution file, and select Manage NuGet packages.

  4. Click the drop down menu beside the package source and select nuget.org.

  5. Search for "WDK".

  6. Select Microsoft.Windows.WDK.x64 or Microsoft.Windows.WDK.ARM64 based on the platform architecture that you wish to develop for.

  7. Leave other checkboxes set at their defaults.

  8. Select Install.

screenshot of Visual Studio NuGet packages being installation dialog

  1. The WDK takes dependencies on the SDK NuGet packages, and it will install the required packages.

  2. Review and accept the license terms to complete the installation.

screenshot of Visual Studio showing a list of three NuGet packages with links to license terms

  1. Build and test your WDK driver solution.

Note

Use of the dotnet command line doesn't work with WDK, and its use is not recommended.

Updating NuGet Packages in existing driver projects

To update NuGet Packages in existing driver projects, follow these steps.

  1. Open the existing driver project in Visual Studio.

  2. Right Click the driver project solution file, and select Manage NuGet packages.

  3. Click on the Updates tab.

  4. Click on the Include prerelease box, if you wish to use prerelease WDK packages.

  5. Select the packages you wish to update in the list.

screenshot of Visual Studio NuGet packages update with WDK and WDK packages

  1. Select Install.

  2. Select Apply.

screenshot of Visual Studio NuGet packages update apply dialog

  1. Review and accept the license terms to complete the installation.

See also

What is NuGet?

Use command-line parameters to install, update, and manage Visual Studio

Download Visual Studio Tools

Download current version of the WDK and Enterprise WDK manually

Download previous versions of the WDK manually

Download the Windows Debugging Tools (WinDbg)