visual-studio 如何删除错误的 Visual Studio 模板?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/789095/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I delete bad Visual Studio templates?
提问by dance2die
How do you remove following noise templates, that don't even work?
您如何删除以下甚至不起作用的噪音模板?


回答by Hamid Behnam
In visual studio: go to Tools>Extensions and Updatesand then uninstall or disable the template
在 Visual Studio 中:转到工具>扩展和更新,然后卸载或禁用模板
回答by Rich L
To save a bit of time for 2010 users, the folder has moved:
为了为 2010 用户节省一些时间,文件夹已移动:
...\My Documents\Visual Studio 2010\Templates\ProjectTemplates
...\我的文档\Visual Studio 2010\Templates\ProjectTemplates
回答by Alex
For Visual Studio 2013, I found my template cache here:
对于Visual Studio 2013,我在这里找到了我的模板缓存:
%USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio.0\ProjectTemplatesCache
回答by JaredPar
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
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\Ide\ProjectTemplatesCache
For a single user they will be at
对于单个用户,他们将在
%USERPROFILE%\Visual Studio 2008\Templates\ProjectTemplates
%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.
如果 InstallVSTemplates 失败,则可能是以下情况之一。我无法帮助的是一些程序随机转储 ProjectTemplatesCache 目录中的文件。
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.
另一个更可能的原因是 ProjectTemplates 目录中有一个错误的模板。InstallVSTemplates 实际上只是通过此目录,并将所有文件解压缩到 ProjectTemplatesCache 目录中。您必须搜索此目录并找到包含添加到项目中的垃圾文件的 .zip 文件。找到该文件后,将其删除,删除 ProjectTemplatesCache,然后重新运行 InstallVSTemplates。
回答by AfterStar
After manually searching for some of the custom profile templates(.vstemplate),I found them at the following location:
在手动搜索了一些自定义配置文件模板 (.vstemplate) 后,我在以下位置找到了它们:
%userprofile%\AppData\Local\Microsoft\VisualStudio.0\Extensions
It appears VS2010 installs some of the templates as extesions or the authors made it that way.I hope this helps someone.
看来 VS2010 安装了一些模板作为扩展或作者这样做了。我希望这对某人有所帮助。
May need to run "devenv /setup" at the run command to refresh the VS2010 after you delete the templates.
删除模板后,可能需要在运行命令中运行“devenv /setup”来刷新 VS2010。
回答by AFD
- Delete the bad/unwanted project folders from
- 从中删除坏的/不需要的项目文件夹
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates
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
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
C:\Users[您的用户名]\Documents\Visual Studio 2008\Templates\ProjectTemplates
and finally open Visual Studio 2008 Command Prompt as Administrator and run
最后以管理员身份打开 Visual Studio 2008 命令提示符并运行
devenv /installvstemplates
devenv /installvstemplates
回答by David Gofman
For Visual Studio Express 2010 you should delete all folders under
对于 Visual Studio Express 2010,您应该删除下的所有文件夹
%USERPROFILE%\AppData\Local\Microsoft\VCSExpress\10.0\Extensions
%USERPROFILE%\AppData\Local\Microsoft\VCSExpress\10.0\Extensions
回答by Nazir A
For me the issue got resolved when I deleted the cache.binfile from ItemTemplatesCachefolder. Full path of this folder is:
对我来说,当我从ItemTemplatesCache文件夹中删除cache.bin文件时,问题得到了解决。这个文件夹的完整路径是:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache
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
- 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
回答by Fratt
For me it was a matter of removing it from here using VS2017: %USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio\15.0_45552a03\ProjectTemplatesCache
对我来说,这是使用 VS2017 从这里删除它的问题:%USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio\15.0_45552a03\ProjectTemplatesCache
回答by tomByrer
For Visual Studio 2013 Community, you have to delete {program folder}\Common7\IDE\ItemTemplatesCache\cache.binafter deleting all the unwanted files as described above. Afterwards VS will rebuild the templates listing in the New Project...dialog.
对于 Visual Studio 2013 社区,您必须{program folder}\Common7\IDE\ItemTemplatesCache\cache.bin在如上所述删除所有不需要的文件后进行删除。之后 VS 将重建New Project...对话框中的模板列表。

