dance2die
dance2die

Reputation: 36965

How can I delete bad Visual Studio templates?

How do you remove the following noise templates that don't even work?

enter image description here

Upvotes: 31

Views: 50937

Answers (15)

dmitrycello
dmitrycello

Reputation: 184

It looks like in each case we use different recipe. Unfortunately, commands line and VS menu command listed in this thread did not work in my case, which is MS VS 2019 Community Edition on Win7 x64:

First, close VS, remove unwanted *.zip files from all following folders, as well as hidden cache.bin file from the last \ProjectTemplatesCache folder (it will be restored at VS startup), then restart VS. Here are those 3 folders:

{Documents}\Visual Studio 2019\My Exported Templates

{Documents}\Visual Studio 2019\Templates\ProjectTemplates

{User}\AppData\Roaming\Microsoft\VisualStudio{Number}\ProjectTemplatesCache

Upvotes: 1

Even Wonder
Even Wonder

Reputation: 1386

You could also try this:

dotnet new --uninstall <PATH|NUGET_ID>

It works for me in VS 2019 and VS 2022 to uninstall the Avalonia templates.

Description

The dotnet new --uninstall command uninstalls a template package at the PATH or NUGET_ID provided. When the <PATH|NUGET_ID> value isn't specified, all currently installed template packages and their associated templates are displayed. When specifying NUGET_ID, don't include the version number.

Examples

Uninstall the Avalonia templates

dotnet new --uninstall Avalonia.Templates

From MicrosoftDocs

Upvotes: 4

Ashraf Mohamed
Ashraf Mohamed

Reputation: 59

Worke for VS 2012 and 2015 :
In Visual Studio: go to Tools > Extensions and Updates and then uninstall or disable the template.

worke in VS 2019 :
1- In VS2019, custom templates can be removed by deleting the template folder from %USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio{VSVersion}\ProjectTemplatesCache. Look for a {VSVersion} that begins with "16".

https://i.sstatic.net/V6SQ5.png

2- Delete What You Want From Templates Folder in {C:\Users\USERName\Documents\Visual Studio 2019\My Exported Templates}

Notes : {ProjectTemplatesCache} Or {ItemTemplatesCache}

https://i.sstatic.net/9BM9p.png

Upvotes: 5

Alex
Alex

Reputation: 876

For Visual Studio 2019: Extensions > Manage extensions > Installed > Uninstall

Upvotes: 4

Hamid Behnam
Hamid Behnam

Reputation: 1010

In Visual Studio: go to Tools > Extensions and Updates and then uninstall or disable the template.

Upvotes: 34

Nazir A
Nazir A

Reputation: 111

For me the issue got resolved when I deleted the cache.bin file from ItemTemplatesCache folder. Full path of this folder is:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache

Also make sure you delete the template files from below locations:

  • C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates
  • C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache
  • C:\Users\Default\Documents\Visual Studio 2010\Templates\ItemTemplates
  • C:\Users[NT-USERNAME]\Documents\Visual Studio 2010\Templates\ItemTemplates

Upvotes: 6

Fratt
Fratt

Reputation: 239

For me it was a matter of removing it from here using VS2017: %USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio\15.0_45552a03\ProjectTemplatesCache

Upvotes: 6

tomByrer
tomByrer

Reputation: 1155

For Visual Studio 2013 Community, you have to delete {program folder}\Common7\IDE\ItemTemplatesCache\cache.bin after deleting all the unwanted files as described above. Afterwards VS will rebuild the templates listing in the New Project... dialog.

Upvotes: 2

Alex
Alex

Reputation: 5656

For Visual Studio 2013, I found my template cache here:

%USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio\12.0\ProjectTemplatesCache

Upvotes: 20

SteveB
SteveB

Reputation: 273

If the template was installed by double clicking a VSIX file, it is considered an extension and can be uninstalled using the technique described by Hamid Behnam above. Otherwise, it can be deleted from one of the template directories mentioned above.

Upvotes: 1

AfterStar
AfterStar

Reputation: 91

After manually searching for some of the custom profile templates(.vstemplate),I found them at the following location:

%userprofile%\AppData\Local\Microsoft\VisualStudio\10.0\Extensions

It appears VS2010 installs some of the templates as extesions or the authors made it that way.I hope this helps someone.

May need to run "devenv /setup" at the run command to refresh the VS2010 after you delete the templates.

Upvotes: 8

David Gofman
David Gofman

Reputation: 31

For Visual Studio Express 2010 you should delete all folders under

%USERPROFILE%\AppData\Local\Microsoft\VCSExpress\10.0\Extensions

Upvotes: 3

Rich L
Rich L

Reputation: 321

To save a bit of time for 2010 users, the folder has moved:

...\My Documents\Visual Studio 2010\Templates\ProjectTemplates

Upvotes: 32

Andrei Drynov
Andrei Drynov

Reputation: 8592

  • Delete the bad/unwanted project folders from

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates

  • Clear cache

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplatesCache

  • Delete stuff from (perhaps not necessary)

C:\Users[Your User Name]\Documents\Visual Studio 2008\Templates\ProjectTemplates

and finally open Visual Studio 2008 Command Prompt as Administrator and run

devenv /installvstemplates

Upvotes: 6

JaredPar
JaredPar

Reputation: 755387

Deleting them off of disk should do the trick. Where they exist will depend a bit on where you installed them. If you installed them for all users they will be at

%ProgramFiles%\Microsoft Visual studio 9.0\Common7\Ide\ProjectTemplatesCache

For a single user they will be at

%USERPROFILE%\Visual Studio 2008\Templates\ProjectTemplates

EDIT

If InstallVSTemplates fails, it is likely one of the following. The one I can't help with is some program randomly dumping files inside of the ProjectTemplatesCache directory.

The other more likely cause is there is a bad template in the ProjectTemplates directory. InstallVSTemplates really just goes through this directory, and unzips all of the files into the ProjectTemplatesCache directory. You will have to search through this directory and find the .zip file which contains the junk files being added to your project Once you find the file, delete it, delete ProjectTemplatesCache, and then re-run InstallVSTemplates.

Upvotes: 11

Related Questions