How to remove/uninstall item templates in Visual Studio 2010
Asked Answered
W

4

10

I have an item template that I did wrong and want to delete. I deleted the zip file from the output location and ran devenv /installvstemplates and devenv /setup and when I opened VS and tried to add a new item it was still there. stranger still, I can still use it and create copies of the file, so it must exist somewhere. Is there somewhere that visual studio stores the files after being installed that I need to delete? I also cant change the template, it stays the same no matter what I do.

Edit: If it makes a difference I am using XNA GS 4.0

Wagner answered 24/11, 2011 at 2:58 Comment(1)
possible duplicate of How can I delete bad Visual Studio templates?Ankylostomiasis
W
4

I finally found out what was happening. For some reason, when VS 2010 installed the templates it copied the zip file to my old 2008 folder. I can't imagine why it would do this but I've put it out there for anyone with the same problem.

Wagner answered 28/11, 2011 at 12:40 Comment(0)
M
8

There are several places the Visual Studio might store a template. Deleting the .zip file from any of the locations below should remove it from the list:

  • %LocalAppData%\Microsoft\VisualStudio\10.0\Extensions
  • %LocalAppData%\Microsoft\VisualStudio\10.0\ -> ProjectTemplatesCache_{xx}
  • %UserProfile%\My Documents\Visual Studio 2010\Templates

If the Template was installed via an extension, you can clear it out from the top directory above, or you can follow the official instructions:

Tools -> Extension Manager -> Installed Extensions -> Templates -> YourTemplate -> [Uninstall|Disable]

Margerymarget answered 28/10, 2013 at 18:48 Comment(0)
W
4

I finally found out what was happening. For some reason, when VS 2010 installed the templates it copied the zip file to my old 2008 folder. I can't imagine why it would do this but I've put it out there for anyone with the same problem.

Wagner answered 28/11, 2011 at 12:40 Comment(0)
A
1

Because the duplicate question is really about Visual Studio 2008 (although it contains answers for 2010), I decided to also post the answer for Visual Studio 2010 (found in a comment).

You can find custom templates at the following location:

C:\Users[user]\Documents\Visual Studio 2010\Templates\ItemTemplates

Delete the zip files and they should be removed from Visual Studio.

Ankylostomiasis answered 24/11, 2011 at 3:27 Comment(3)
The folder is empty on my hard drive, there are no zip or vstemplate files in that folder. :(Wagner
This doesn't work for me, they still appear in the add new dialogueWagner
I have now deleted all the template files from all caches and personal user templates and visual studio is still showing all of them. I'm pretty sure that it's not refreshing the cache properly.Wagner
B
0

For those who use VS 2019 or VS 2022, you could also try this:

dotnet new --uninstall <PATH|NUGET_ID>

It works for me in VS 2019 and VS 2020 to uninstall Avalonia templates. Maybe it will work for older VS versions, but I haven't tried.

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

Beaverboard answered 24/11, 2021 at 5:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.