You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多
文档控制台
免费开始使用

Visual Studio 2017社区版DirectX项目模板缺失求助

Fixing Missing DirectX Project Templates in Visual Studio 2017 Community

Hey there, I’ve run into similar template glitches with older VS versions before, so let’s walk through some practical fixes to get your DirectX templates showing up:

  • Search directly instead of browsing categories
    Sometimes templates get buried or filtered out by accident. In the "New Project" window, use the top-right search bar to type DirectX—this skips category navigation and might pull up the templates you need. Also, double-check that you haven’t restricted the search to specific languages or platforms (make sure "All Languages" and "All Platforms" are selected).

  • Re-register VS templates
    Corrupted template registration is a common culprit. Here’s how to reset it:

    1. Open Command Prompt as Administrator.
    2. Navigate to your VS 2017 IDE directory (default path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE).
    3. Run the command: devenv /installvstemplates
    4. Wait for the process to finish, then restart Visual Studio. This forces VS to re-install all built-in templates, including DirectX ones.
  • Verify Windows SDK version compatibility
    VS 2017’s DirectX templates are tied to specific Windows 10 SDK versions. If you installed a newer SDK that’s not fully compatible with VS 2017, the templates might fail to load. Try installing an older SDK version (like 10.0.17763.0 or 10.0.16299.0) via the VS Installer:

    1. Open VS Installer, select "Modify" for your VS 2017 installation.
    2. Go to the "Individual Components" tab, scroll to "SDKs, libraries, and frameworks".
    3. Check an older Windows 10 SDK version, click "Modify" to install it, then restart VS.
  • Manually set up a DirectX project (if templates still don’t appear)
    If all else fails, you can build a DirectX project from scratch:

    1. Create an empty C++ Windows Desktop project.
    2. Open Project Properties:
      • Under C/C++ > General, add $(WindowsSDK_IncludePath) to "Additional Include Directories".
      • Under Linker > General, add $(WindowsSDK_LibraryPath_x86) (or x64, depending on your target platform) to "Additional Library Directories".
      • Under Linker > Input, add common DirectX libraries like d3d11.lib, dxgi.lib, d3dcompiler.lib to "Additional Dependencies".
    3. Add a main .cpp file and paste in basic DirectX initialization code (plenty of minimal DirectX 11/12 setup examples exist online to get you started).
  • Run a full VS repair
    Sometimes component installations get corrupted even after re-installing individual packages. Open VS Installer, select "Modify" for your VS 2017 installation, then click the "Repair" button. This will scan and fix any missing or damaged files related to your installation.

内容的提问来源于stack exchange,提问作者xyz

火山引擎 最新活动