删除自动导入的自定义项目模板
我删除了放置在导出模板文件夹中的导出 zip 文件,当然它仍然显示在 Visual Studio 的“添加新项目”对话框中。我预料到了这一点,但我很难找到模板文件的其他存储位置。如何删除自定义模板?
编辑
我搜索了以下文件夹(以及许多其他文件夹,但这些是最明显的): %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates
%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache
%userprofile%\Documents\Visual Studio 2010\我导出的模板
%userprofile%\Documents\Visual Studio 2010\Templates\ProjectTemplates
不确定这是否重要,但我的操作系统也使用 Windows 7。
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. 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
尝试在
%userprofile%\Application Data\Microsoft\VisualStudio\10.0\ProjectTemplatesCache
下查找。这是通常存储模板的解压缩缓存的位置。如果不存在,请尝试在用户数据目录中的任意位置搜索名为 ProjectTemplatesCache 的文件夹。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.模板也存储在“我的文档\Visual Studio 2010\Templates”中。在 ProjectTemplates 和 ItemTemplates 下等等,具体取决于语言。
编辑:我刚刚导出了一个项目模板。该 zip 文件是在 2 个位置创建的:
删除这两个位置也会从新项目对话框中删除该选择,因此我不确定您的计算机上发生了什么:(
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:
deleting both of these also removed the choice from the new project dialog, so I'm not sure what's happening on your machine :(
我的操作系统Windows 8.1,我使用Visual Studio 2013。
这是自定义模板的路径;
对于这种情况,我的自定义模板路径如下:
My OS Windows 8.1 and I use Visual Studio 2013.
Here is the path of Custom Templates;
For this case, my path of custom templates like;
至少对于 VSIX 模板,官方方式使用VS2010很简单:
工具
->扩展管理器...
->已安装的扩展
->模板
->$yourTemplate
->[Uninstall|Disable]
如果这首先适合您,那么您不必浪费时间具有不同的文件夹布局。
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.
如果有人需要 VS 2015 和 Windows 7 的答案(我知道),它是 %UserProfile% \Documents\Visual Studio 2015\Templates\ProjectTemplates
if anyone need the answer for VS 2015 and Windows 7(I know) it's %UserProfile% \Documents\Visual Studio 2015\Templates\ProjectTemplates
为了完整起见,以下是您必须访问的所有路径,以清除 VS 2019 中的模板残留:
首先关闭 VS...
C:\Users\USER\Documents\Visual Studio 2019\My Exported Templates
C:\Users\USER\AppData\Local\Microsoft\VisualStudio\16.0_xxxxxxxx\ProjectTemplatesCache_{GUID}
>对于项目模板(如果有)重复步骤 5。
注意:清除压缩模板、*.bin 文件和包含模板项的子文件夹。
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...
C:\Users\USER\Documents\Visual Studio 2019\My Exported Templates
C:\Users\USER\Documents\Visual Studio 2019\Templates\ProjectTemplates
C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\16.0_xxxxxxxx
C:\Users\USER\Application Data\Microsoft\VisualStudio\16.0_xxxxxxxx
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.
手动搜索一些自定义配置文件模板(.vstemplate)后,我在以下位置找到了它们:
看来 VS2010 将一些模板安装为扩展,或者作者这样做了。我希望这对某人有帮助。
删除模板后,可能需要在运行命令中运行“devenv /setup”来刷新 VS2010。
After manually searching for some of the custom profile templates(.vstemplate),I found them at the following location:
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.
如果您仍然看到“新建项目...”对话框中显示不需要的模板,则必须删除(对于 Visual Studio 2013 Community)
{程序文件夹}\Common7\IDE\ItemTemplatesCache\cache如上所述删除所有不需要的文件后。之后 VS 将重建模板列表。
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.我能够通过首先删除以下文件夹中的模板 zip 文件来解决 Visual Studio Community 2017 的此问题:
然后删除以下文件夹:(
“15.0_”后的标识符可能会有所不同)
I was able to solve this problem for my Visual Studio Community 2017 by first deleting the template zip files in the following folders:
Then deleting the following folder:
(The identifier after "15.0_" might vary)
就我而言,Windows 10 上的 Visual Studio 19 是这个文件夹:
%userprofile%\AppData\Roaming\Microsoft\VisualStudio[VS_VERSION]\ProjectTemplatesCache
我删除了模板文件夹,瞧!
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!