NeuroAgent

How to Restore Missing Templates in Visual Studio

Fix missing project templates in Visual Studio. Learn how to install missing components via installer, command line, and restore templates. Step-by-step guide for developers.

Question

How can I resolve the issue of missing the required template when creating a project in a Visual Studio solution?

When I try to create a project within an existing Visual Studio solution, I cannot find the necessary project template. After clicking on the “Install additional tools and features” option, a window appears. How do I properly install the missing components or find the required project template?

NeuroAgent

If the needed project template is missing in Visual Studio, you should check the installation of corresponding components through the Visual Studio installer or add the necessary workloads. The issue is often resolved by installing “Additional project templates (previous versions)” in the ASP.NET and web development section.

Contents

Basic Solution Methods

The issue with missing project templates in Visual Studio typically occurs due to incomplete installation of components or workloads. There are several effective ways to solve this problem:

  1. Through Visual Studio Installer - the most reliable method
  2. Through Visual Studio interface - quick access to components
  3. Through command line - for advanced users
  4. Through cache clearing - if the issue is related to caching

Important: Before taking any actions, ensure you have administrator rights on the computer.

Step-by-Step Guide Through Visual Studio Installer

Step 1: Launch Visual Studio Installer

Open the Start menu and search for “Visual Studio Installer”. Run the application as an administrator.

Step 2: Modify Installation

  1. Find the installed version of Visual Studio in the list
  2. Click the Modify button
  3. In the window that opens, go to the Workloads tab

Step 3: Find the Required Workload

Locate the workload that corresponds to your project. For example:

  • ASP.NET and web development” for web projects
  • “.NET desktop development” for desktop applications
  • “Game development with Unity” for game projects

Step 4: Install Additional Components

  1. Go to the Individual components tab
  2. Expand the appropriate category (e.g., “ASP.NET and web development”)
  3. Check the box for “Additional project templates (previous versions)”

Tip: According to Microsoft Learn, this component is often the reason for missing templates for older project versions.

Step 5: Complete Installation

Click the Modify button and wait for the installation of the required components to complete.


Using Command Line to Restore Templates

If the standard methods don’t work, you can use the Visual Studio command line:

Method 1: Installing Templates

  1. Open “Developer Command Prompt for VS”
  2. Run the command:
    devenv.exe /installvstemplates
    
  3. Wait for the installation to complete

Method 2: Updating Configuration

If the issue is related to extension cache, use the command:

devenv /updateconfiguration

Important: As noted by users on Reddit, this command triggers a more comprehensive update of extension caches.

Method 3: Clearing Template Cache

Sometimes deleting the template cache helps:

  1. Close Visual Studio
  2. Delete the ProjectTemplatesCache_*, ItemTemplatesCache_*, and VTC files from:
    %APPDATA%\Microsoft\VisualStudio\<version>_<id>\
    

Additional Checks and Solutions

Checking Through Visual Studio Interface

If you already have Visual Studio open:

  1. Select Tools → Get Tools and Features
  2. In the window that opens, check for the necessary components
  3. Install any missing components if needed

Manually Searching for Templates

Sometimes templates are hidden but available through search:

  1. When creating a new project, use the search field
  2. Enter keywords for the required template
  3. Check the “Installed” section in the project creation dialog

Reinstalling the Work Component

If you see an error about “missing installation components” as described in Microsoft Q&A, install:

  • C++ (v142) build tools for Universal Windows Platform
  • SDK for your project’s target platform

Conclusion

To resolve the issue with missing project templates in Visual Studio, follow these steps:

  1. Check component installation through Visual Studio Installer
  2. Install “Additional project templates (previous versions)” in the appropriate workload
  3. Use the command line to restore templates with devenv /installvstemplates
  4. Clear the cache if the issue persists
  5. Check for templates manually in the project creation dialog

Most often, the issue is resolved by installing additional components through Visual Studio Installer, especially “Additional project templates (previous versions)”. If standard methods don’t work, try clearing the cache or reinstalling the corresponding workloads.

Sources

  1. Modify Visual Studio workloads and components | Microsoft Learn
  2. How to solve Missing Templates in Visual Studio Enterprise 2019? - Microsoft Q&A
  3. All project templates don’t appear in Visual Studio 2022 - Stack Overflow
  4. Visual Studio 16.9.3 Item Templates Missing - Reddit
  5. Missing Install Components - Microsoft Q&A
  6. I’m missing a few project templates in VS 2022 - Microsoft Q&A