How to set copyright in Visual Studio 2017

1.VisualStudio2017 set copyright  

In team development or company development, we generally like to set copyright instructions for the classes or interfaces and other templates we create, but it is very laborious to add each class one by one, so in general, we set Template to implement it, when you create a class or interface in VS, etc. automatically add these annotations to the class or interface you are in.  

I briefly summarize the instructions for adding copyright to VS2017  

1. First find your installation path. If you forget your installation path, it doesn't matter. You can use the following address to find it: Find the VS icon, right-click Properties: pop up as shown in the figure:

Find the address drawn by the red line in the figure, copy it, remove the last devenv.exe and double quotation marks, copy the path and open my computer and copy it to the path address, open it as shown in the figure:

 

 3. Continue to search down, the path is as follows: (D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ItemTemplates\CSharp\Code\2052

 4. Open the Class and Interface folders, open the Class.cs and Interface.cs files below, copy the copyright to it, click Save, the configuration is complete, and reopen VS.

 

Class.cs

#region << version note >> Note: X is not custom input

/**************************************************** ****************************
*Copyright (c) $year$ XXXXXX All Rights Reserved.
*CLR Version: $clrversion$
*Machine Name : $machinename$
*company name: XXXXXX
*namespace: $rootnamespace$
*filename: $safeitemrootname$
*version number: V1.0.0.0
*unique ID: $guid10$
*current user domain: $userdomain$
*created Person: XXX
*Email:
*Created: $time$
*Description:
*================================== ===============================================
*modification mark
*modification time : $time$
*Modified By: XXXX
*Version: V1.0.0.0
*Description:
**************************** ****************************************************/
# endregion

 

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

 

 

 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Interface.cs

#region << 版 本 注 释 >>
/****************************************************************************
*Copyright (c) $year$ XXXXXX All Rights Reserved.
*CLR版本: $clrversion$
*机器名称:$machinename$
*公司名称:XXXXXX
*命名空间:$rootnamespace$
*文件名: $safeitemrootname$
*版本号: V1.0.0.0
*唯一标识:$guid10$
*当前的用户域:$userdomain$
*创建人: XXXXXX
*电子邮箱:
*创建时间:$time$
*描述:
*============================================================================
*修改标记
*修改时间:$time$
*修改人: XXXXXX
*版本号: V1.0.0.0
*描述:
*****************************************************************************/
#endregion

 

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325816752&siteId=291194637