让VS2013添加新类时自动添加public关键字

1、找到VS2013安装目录

C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEItemTemplatesCacheCSharpCode2052Interface

打开其中的Interface.cs

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$
namespace $rootnamespace$
{
    public interface $safeitemrootname$
    {
    }
}

再 interface  之前添加 public 

C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEItemTemplatesCSharpCode2052Class

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$
namespace $rootnamespace$
{
    public  class $safeitemrootname$
    {
    }
}

在class 之前添加public

原文地址:https://www.cnblogs.com/zjgtlkj/p/5702620.html