【问题标题】:How can I set up Visual Studio 2017 to develop drivers?如何设置 Visual Studio 2017 来开发驱动程序?
【发布时间】:2019-02-22 21:12:17
【问题描述】:

根据这个论坛,https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/windows-wdk-on-visual-studio-2017-community/fdbd2b44-e57a-4849-903d-04001205a764 Visual Studio 2017 目前不支持 Windows Driver Kit。

我尝试安装 Windows 驱动程序工具包,但测试驱动程序项目(例如这个)无法构建

https://github.com/Microsoft/Windows-driver-samples/tree/master/serial/VirtualSerial

我在构建时收到此错误: 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".

我已经尝试将解决方案重新定位到我拥有的两个选项:10.0.17134.0 和 8.1,但同样的错误不断出现。

我需要做什么来构建这个示例驱动程序?我需要安装VS2015吗? VS2017社区版?为什么 Visual Studio 2017 专业版不支持这个 WDK?

谢谢,

【问题讨论】:

  • 请参阅docs,其中指出版本 1803 的 Windows 10 DDK 支持 VS 2017。
  • 安装17134 SDK + WDK
  • 我安装了 SDK 和 WDK build 17758。但是在 Platform Toolset 下,WindowsUserModeDriver10.0 显示为 Not Installed 该项目的目标是 10.0.17758.0
  • @Chuck Walbourn 该页面现在只讨论 VS2019 和 Win10 1903。 VS2019 占用 30GB+ 磁盘,只带来错误并移除了好的功能。

标签: visual-studio-2017 windows-10 driver


【解决方案1】:

Visual Studio 2017 绝对支持内核模式设备驱动开发;毫无疑问,因为我已经使用 VS17 很多很多个月了。

使用可以从 MSDN 下载和安装的最新版本的 Windows Driver Kit (WDK):https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk

此外,您始终可以使用 Enterprise WDK,然后如果您想从命令行使用它,您可以简单地使用它进行构建。 (也可以在上面链接到的页面上找到)

【讨论】:

  • 不是我,我赞成答案,但它仍然没有回答我的问题。我安装了 SDK 和 WDK build 17758。但是在 Platform Toolset 下,WindowsUserModeDriver10.0 显示为 Not Installed 该项目的目标是 10.0.17758.0
【解决方案2】:

为您的 Visual Studio 2017 版本下载正确的 WDK 安装程序:

访问https://docs.microsoft.com/en-us/windows-hardware/drivers/other-wdk-downloads了解更多信息。

【讨论】:

    【解决方案3】:

    不完全是解决方案,但 Windows 8.1 WDK 可与 Visual Studio 2017 Enterprise 配合使用,

    从这里下载,只需要将项目重新定位到 8.1

    https://www.microsoft.com/en-us/download/confirmation.aspx?id=42273

    此外,我需要获取 VS2015 C++ Build Tool 来修复缺少的 Microsoft.cpp.props 错误 http://download.microsoft.com/download/5/F/7/5F7ACAEB-8363-451F-9425-68A90F98B238/visualcppbuildtools_full.exe

    【讨论】:

      【解决方案4】:

      为windows开发驱动程序是一件很有趣的事情,将接触到高级操作系统概念。环境的设置将是IDE

      1. IDE - Visual Studio (https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16)
      2. 编译器 (WDK)
      3. 调试器 (WDK)

      WDK 包含两者 (https://go.microsoft.com/fwlink/?linkid=2085767)。最新的 Visual Studio(VS2019) 将与最新的 WDK(10、1903 至今)一起提供。

      有时插件可能无法正常工作,即 Visual Studio 和 WDk 之间的集成问题。

      • 转到位置“C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019”并运行 VSIX 安装程序。
      • 现在在一个新项目中,可以使用与驱动程序相关的模板。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-07-19
        • 1970-01-01
        • 2017-12-23
        • 1970-01-01
        • 1970-01-01
        • 2018-05-13
        • 2012-06-12
        • 1970-01-01
        相关资源
        最近更新 更多