Visual Studio 2022 Version 17.1.5 Missing "class" template

Shawn 1 Reputation point
2022-06-05T21:32:16.79+00:00

As of this morning when I use the "Add New Item" menu, or even use the shortcut in the context menu to add a new class, it can't find the template for a new class. The "Add New Item" menu in general does not contain anything for adding a new class. This obviously isn't the end of the world since I can just create a new code file and manually add the definitions, but it's really a bump in my traditional workflow.

I have not installed any new extensions in months and really I have not made any changes to my development environment in recent weeks. If I navigate to the "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class" directory I can see both the Class.cs file as well as the Class.vstemplate file.

I've tried a few things such as removing some of the template folders out of the User/Documents folder and such but nothing so far has worked. Has anyone else encountered this issue?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,602 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,238 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ken Tucker 5,846 Reputation points
    2022-06-05T22:06:38.827+00:00

    I would do a repair on your visual studio 2022. There is an updated version you can install

    0 comments No comments

  2. Shawn 1 Reputation point
    2022-06-06T13:48:55.907+00:00

    I did a repair, I will try updating to the new version and see if that helps.