开发者

Remove Custom Project Template that was Automatically Imported

I deleted the exported zip file that was placed in my exported templates folder and of course it still shows in Visual Studio's "Add New Project" dialog. I expected that but I'm having a difficult time finding where else the template files are stored.开发者_StackOverflow How do I remove a custom template?

Edit

I've searched the following folders (and numerous others, but these are the most obvious): %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache %userprofile%\Documents\Visual Studio 2010\My Exported Templates %userprofile%\Documents\Visual Studio 2010\Templates\ProjectTemplates

Not sure if it matters, but I'm also using Windows 7 for my OS.


Try looking under %userprofile%\Application Data\Microsoft\VisualStudio\10.0\ProjectTemplatesCache. This is where the unzipped cache of the template would usually be stored. If it isn't there, try searching for a folder named ProjectTemplatesCache anywhere in your user data directory.


Templates are also stored in "My Documents\Visual Studio 2010\Templates". Under ProjectTemplates and ItemTemplates and so on depending on the language.

EDIT: i just exported a project template. The zip file was created in 2 locations:

 My Documents\Visual Studio 2010\My Exported Templates\mytemplate.zip 
 My Documents\Visual Studio 2010\Templates\ProjectTemplates\mytemplate.zip

deleting both of these also removed the choice from the new project dialog, so I'm not sure what's happening on your machine :(


My OS Windows 8.1 and I use Visual Studio 2013.

Here is the path of Custom Templates;

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

For this case, my path of custom templates like;

C:\Users\xxxxx\AppData\Roaming\Microsoft\VisualStudio\12.0\ProjectTemplatesCache


At least for VSIX templates, the official way using VS2010 simply works:

Tools->Extension Manager...->Installed Extensions->Templates->$yourTemplate->[Uninstall|Disable]

If that works for you in the first place, you don't have to mess around with different folder layouts.


if anyone need the answer for VS 2015 and Windows 7(I know) it's %UserProfile% \Documents\Visual Studio 2015\Templates\ProjectTemplates


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.


For the sake of completeness here are all the paths you have to visit to clear template leftovers in VS 2019:

First close down VS...

  1. C:\Users\USER\Documents\Visual Studio 2019\My Exported Templates
  2. C:\Users\USER\Documents\Visual Studio 2019\Templates\ProjectTemplates
  3. C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\16.0_xxxxxxxx
  4. C:\Users\USER\Application Data\Microsoft\VisualStudio\16.0_xxxxxxxx
  5. C:\Users\USER\AppData\Local\Microsoft\VisualStudio\16.0_xxxxxxxx\ProjectTemplatesCache_{GUID}

Repeat step 5 for Item templates if any.

NOTE: Clear zipped templates, *.bin files and subfolders containing template items.


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


I was able to solve this problem for my Visual Studio Community 2017 by first deleting the template zip files in the following folders:

%UserProfile%\Documents\Visual Studio 2017\Templates\ProjectTemplates
%UserProfile%\Documents\Visual Studio 2017\My Exported Templates

Then deleting the following folder:

%UserProfile%\AppData\Roaming\Microsoft\VisualStudio\15.0_aed38a72\ProjectTemplatesCache

(The identifier after "15.0_" might vary)


In my case with Visual Studio 19 on Windows 10 it was this folder:

%userprofile%\AppData\Roaming\Microsoft\VisualStudio[VS_VERSION]\ProjectTemplatesCache

I deleted the template folder and voila!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜