Visual Studio编辑类模板的位置

VS的版本一直在不断更新,每个版本的安装目录都是有一点变化,所以模板文件的位置也是不一样的,下面是从StackOverflow看到的一个大合集,转发记录一下:

Extract, edit and recompress. Paths are for the class template, but the interface templates are in the same folder.

You may want to edit the VS template file in each to remove the fact that they don't automatically add references to the assemblies System, System.Data and/or System.Xml.

2005:

C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\Class.zip

2008:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

2010:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

Starting with Visual Studio 2012, the templates are not zipped, so you can edit each .cs template in each applicable folder directly.

2012:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs

2013:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs

2015:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs

2017

VS 2017 changes the directory location, and is now dependent on your edition (Professional/Enterprise/etc). So for the Enterprise edition:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs

Notes

Express Editions

In Express Editions you will have to search in the subdirectory WDExpress inside the IDE folder, so e.g. for VS 2015 Express:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\WDExpress\ItemTemplates\CSharp\Code\1033\Class\Class.cs

Other Languages

If you don't use the English version of Visual Studio, the folder 1033 may not exist, but a different number representing your language. For example it is 1031 in a German installation.

原文地址:https://stackoverflow.com/questions/2072687/how-do-i-edit-the-visual-studio-templates-for-new-c-sharp-class-interface

转载于:https://www.cnblogs.com/jerryqi/p/10091413.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值