Visual Studio ®, project template, install, uninstall
XXX wxWidgetsProTemp example

Visual Studio® Custom Project Templates

Introduction

Visual Studio comes with a lot of Project Templates, e.g. for a Windows C++ Console Application. But it is possible to add custom project templates, which are zip files. This document describes how to install such project templates, e.g. my wxWsProTemp (wxWidgets Visual Studio Project Template). With wxVsProTemp you can create a wxWidgets project, which results in a full (running) wxWidgets application with separate header and C++ source files and an icon which is shown in the application and in the Windows File Explorer for the executable file.

The following abbreviations for folders (directories) are used in this document:

{Documents} Your documents folder, e.g. C:\Users\user_name\Documents
{User} Your User folder, e.g. C:\Users\C:\Users\user_name

Installing a Custom Project Template

Close Visual Studio and copy the zip file with the project Template to:

{Documents}Visual Studio 2022\Templates\ProjectTemplates

Albeit the official Microsoft documentation says, that you also can install it in subfolders thereof, e.g. ‘Visual C++’, this does not work on my Windows machines(!).

Uninstall a Project Template

Unfortunately, this seems to be different for different versions of Visual Studio and also depends on whether Visual Studio was installed for the user only or for all users. For me (only installed for me) and Visual Studio 2022 the following worked:

Close (quit) Visual Studio and remove all unwanted project templates (Visual Studio project templates are *.zip files) from the following directories:

{Documents}\Visual Studio 2022\My Exported Templates

Documents}Visual Studio 2022\Templates\ProjectTemplates
(or in subfolders thereof, e.g. ‘Visual C++’)

{User}\AppData\Roaming\Microsoft\VisualStudio\{Number}\ProjectTemplatesCache
(or in subfolders thereof, e.g. ‘Visual C++’)
{Number} is 17_... for Visual Studio 2022 (e.g. 17.0_1c362944)

In this folder also remove the hidden(!) file cache.bin (will be created again when Visual Studio will be started).

Albeit the custom project templates will then be removed, they will still appear in the history, if you create a new project (of course the creation of the project will fail, as the templates are deleted). To clear them also from the history start PowerShell and enter:

Set-Location "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE" .\devenv.exe /resetuserdata

Warning(!): This also clears your user account in, Visual Studio. You must sign in again with your Microsoft user account(!).

Then restart Visual Studio