3

I need to work on a Windows 10 specific driver type. Getting and installing the WDK 10.0.10075 is no problem. I had Visual Studio 2013 Pro installed prior to installing the WDK.

How can I now integrate the WDK into Visual Studio? I know the Visual Studio 2015 RC is available, but I'd prefer to use the Visual Studio 2013 IDE for now and the Windows driver samples contain Visual Studio 2013 solutions.

However, when I open the solution and attempt to build it, I get:

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,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 "Upgrade Solution...".
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Full text as a quote for more convenient reading:

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 "Upgrade Solution...".

Unsurprisingly I don't get "Upgrade Solution..." as an option in the context menu of the solution and I don't see it in the "Project" submenu of the main menu either.

Is there a way to make the Windows 10 WDK tool set known to MSBuild such that Visual Studio 2013 can handle it?


So the Windows 10 WDK registers itself inside C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140 (as opposed to v120 for the VS 2013 stuff, I guess someone was superstitious about using internal version number 13.x for VS 2015?).

What I tried first was to take a backup of C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140 and C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v120 respectively.

I then merged the files and folders from under v140 into v120. No files were overwritten in the process, by the way.

Trying to build once again using this, I got another error:

1>C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(178,5): error : An SDK corresponding to WDK version '' was not found. Please install the SDK before building.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

As a block quote:

error : An SDK corresponding to WDK version '' was not found. Please install the SDK before building.

Promising. I had indeed not installed the respective SDK just yet. So I went and did that (Windows 10 SDK 10.0.10069). Unfortunately the error message stays the same after installation of that SDK.

0xC0000022L
  • 20,597
  • 9
  • 86
  • 152

2 Answers2

2

The online samples should be for VS 2015 RC. A lot of the samples have even been converted to be universal driver samples.

For kernel mode drivers, it should be possible by moving various MSBuild files and editing some of them, which is similar to what you tried to do. Note that this is not officially supported in any way. For user mode drivers, it is very unlikely that it will work. The Windows 10 WDK has a dependency on the matching SDK version, and because of all the changes that were made to support universal apps and drivers development, the SDK is tightly coupled with VS 2015.

In the MSBuild toolset, there are also a bunch of properties that are assumed to be defined, and some of those will only be defined if you are using VS 2015.

Note that your SDK and WDK versions must match. SDK 10.0.10069 does not match WDK version 10.0.10075.

Max Ouellet
  • 306
  • 1
  • 3
  • Hmm, no newer SDK was available at the time I posted my question despite update checks (ergo no matching versions). Also the `.sln` file states `# Visual Studio 2013` and `VisualStudioVersion = 12.0` and the project shows `ToolsVersion="12.0"` suggesting this was/is created and maintained with Visual Studio 2013. This all seems a bit messy for developers at the moment. Still the answer addresses some of the points, thanks. – 0xC0000022L Jul 27 '15 at 07:33
  • I looked at the samples, and while they do have ToolsVersion="12.0" (which is wrong), they are the new Win 10 samples. They contain MSBuild properties that did not exist in WDK 8.1, so they wouldn't work with any previous WDK. – Max Ouellet Jul 31 '15 at 16:48
  • just guessing from how you wrote your answer, I wonder whether you know (or could ask around) regarding [this question](http://stackoverflow.com/q/35940134). Even a support request did not yield *any* results. – 0xC0000022L Jun 01 '16 at 18:11
  • I can ask around, I don't know myself... There's an [OSR thread](https://www.osronline.com/showthread.cfm?link=269544) about it as well. – Max Ouellet Jun 03 '16 at 03:31
  • thanks. Yes, I am aware of that OSR thread and I also cited it in my support case with Microsoft. – 0xC0000022L Jun 03 '16 at 03:43
-1

$(LatestTargetPlatformVersion) instead of hard coded TargetPlatform version like 10 or 8.1