模板设置是为了在“添加新项”时默认格式

1、打开文件:D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\2052\Class

2、把文件中的模板修改自定义的格式

如:

把如下代码修改为自己设置的格式

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$
{
    class $safeitemrootname$
    {
    }
}

修改为

/*
 * 创建人:   hllive
 * 创建时间: 2017/6/12 17:30:01
 * 描述:     $description$
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace es.Common
{
    public class Class2
    {
    }
}

格式可以自定义

效果:

vs2013代码模板设置

 

相关文章:

  • 2021-07-09
  • 2021-04-07
  • 2021-05-13
  • 2021-09-02
  • 2022-12-23
  • 2021-10-11
  • 2022-01-07
  • 2021-09-15
猜你喜欢
  • 2021-11-26
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-07-29
  • 2022-12-23
相关资源
相似解决方案