- Using Visual Studio or MSBuild to build a driver
- Building a Driver Using Visual Studio
- Building a Driver Using the Command Line (MSBuild)
- Configuring project properties for your driver and driver package
- Troubleshooting tip for building a driver
- 2021 Best Two Useful Disk Utilities in Windows (10/8/7/Vista/XP)
- Contents
- 1. Disk Utility in Windows — Disk Management
- How to Use Disk Management
- 2. EaseUS Disk Utility in Windows — EaseUS Partition Master
- How to Use EaseUS Disk Utility — Partition Master:
- Other Disk Utilities in Windows
Using Visual Studio or MSBuild to build a driver
This topic describes how you can build a driver using the Visual Studio development environment, or from the command line by using the Microsoft Build Engine (MSBuild).
ImportantВ В Starting in Windows Driver Kit (WDK)В 8, MSBuild replaced the Windows Build Utility (Build.exe). The WDK now uses the same compiler and build tools that you use to build Visual Studio projects. Driver projects that were built with previous versions of the WDK must be converted to work in the Visual Studio environment. You can run a conversion utility from the command line, or you can convert an existing driver by creating new Visual Studio project from existing sources. For more info, see Creating a Driver From Existing Source Files and WDK and the Visual Studio build environment.
Building a Driver Using Visual Studio
You build a driver the same way you build any project or solution in Visual Studio. When you create a new driver project using a Windows driver template, the template defines a default (active) project configuration and a default (active) solution build configuration.
NoteВ В You can convert projects and solutions that you created with WDKВ 8 or Windows Driver Kit (WDK)В 8.1 to work with Windows Driver Kit (WDK)В 10 and Visual StudioВ 2019. Before you open the projects or solutions, run the ProjectUpgradeTool. The ProjectUpgradeTool converts the projects and solutions so that they can be built using WDKВ 10.
For information about managing and editing build configurations, see Building in Visual Studio.
The default Solution build configuration is Debug and Win32.
To select a configuration and build a driver
- Ensure that you have the same version of SDK and WDK installed on your computer.
- Open the driver project or solution in Visual Studio.
- Select and hold (or right-click) the solution in the Solutions Explorer and select Configuration Manager.
- From the Configuration Manager, select the Active solution configuration (for example, Debug or Release) and the Active solution platform (for example, Win32) that correspond to the type of build you are interested in.
- Select and hold (or right-click) the Avshws project and select Properties. Navigate to Driver Settings > General, and set Target OS Version and Target Platform.
- Configure the project properties for your driver or driver package. You can set properties for deployment, driver signing, or other tasks. For more information, see Configuring project properties for your driver and driver package.
- From the Build menu, select Build Solution (Ctrl+Shift+B).
Building a Driver Using the Command Line (MSBuild)
You can build a driver from the command line using the Visual Studio Command Prompt window and the Microsoft Build Engine (MSBuild)
To build a driver using the Visual Studio Command Prompt window
Open a Developer Command Prompt for VS2019 window.
From this window you can use MSBuild.exe to build any Visual Studio project by specifying the project (.VcxProj) or solutions (.Sln) file.
Navigate to the project directory and enter the MSbuild command for your target.
For example, to perform a clean build of a Visual Studio driver project called MyDriver.vcxproj using the default Platform and Configuration, navigate to the project directory and enter the following MSBuild command:
Syntax — To specify a specific configuration and platform, use the following command syntax:
For example, the following command builds a driver for the «Debug» configuration, «Win32» platform, and for WindowsВ 10.
The TargetPlatformVersion setting is optional and allows you to specify the kit version to build with. The default is to use the latest kit.
Configuring project properties for your driver and driver package
You use property pages to configure and set options for your driver and driver package. You can choose to configure your driver so that it is automatically signed when you build your solution, or automatically deployed to a remote test computer.
The WDK provides a number of command-line tools, such as Stampinf and WPP Preprocessor (WPP Tracing), that are commonly included in the build process. These tools are not distributed with Visual Studio. To combine these tools with the Visual Studio build environment they are wrapped as WDK tasks for MSBuild. If you use one of the driver templates or have an existing driver that you have converted, these property pages might already exist for your project. If not, the property pages are automatically added to your project as you add the related file types to the project or solution (for example, .mc or .man files for the message compiler). For more information, see WDK and the Visual Studio build environment
You can set properties for an individual driver or for an entire driver package. The following table shows some of the available properties that you can configure specifically for drivers and driver packages.
Driver Project Properties | Driver Package Properties |
---|---|