VS2010 Automatically add copyright information

Source: Internet
Author: User

Original: http://www.cnblogs.com/justconnor/archive/2013/04/07/3006331.html

Automatically generate copyright information settings

Most companies now require the clerk to add copyright information to the head of the program file as follows:

/******************************************************************
* Copyright (C): * * Company
* Namespace:test
* FILENAME:WEBFORM4
* Create By:connor 2013/4/7 21:02:15
* Description:

* Update by:
* Update Description:
******************************************************************/

This can be achieved with the following settings in VS:

First, find the installation path for VS as my installation path is: D:\Software\VS2010\Common7\IDE\ItemTemplatesCache\CSharp\Web\2052

Second, modify the corresponding file template such as: \webclass.zip under the Class.cs file

Third, in the header of the file to add the content format:

/******************************************************************

* Copyright (C): * * * Company

* CLR version: $clrversion $

* Namespace Name: $rootnamespace $

* File name: $safeitemname $

* GUID1: $guid 1$

* Creation time: $time $

******************************************************************/

When you save the file next time you add a class file to your Web project, VS automatically adds a custom copyright message to the header of the new class file.

Http://www.cnblogs.com/mcgrady/p/3749584.html

In the development process, we often need to add the public modifier to the class or interface (the default is not) and some related comment information, the work is mechanical and boring, and this simple need can be modified by the VS comes with the class template to achieve, the following is the detailed modification steps.

1, locate the directory C:\Program Files (x86) \microsoft Visual Studio 10.0\common7\ide\itemtemplates\csharp\code\ 1033. Locate the Class.zip file and back up. "Backup is an optional operation"

2. Open the compressed file and further open the Class.cs file in it, add the public modifier before the "class" in the file, and add the copyright Comment information before namespace, then save and update to class.zip,1.

3, run Visual Studio command Prompt (2010) as Administrator, and Run command devenv/installvstemplates to update the template, the change takes effect immediately after the run succeeds. Now that the template has been modified, you can create a new class to see the effect.

If you want to add this information to interface, modify the method as above.

Back to Top

VS2012 Modify Method:

VS2012 modification method with the VS2010, mainly the document records are different.

VS2012 's response is: C:\Program Files (x86) \microsoft Visual Studio 11.0\common7\ide\itemtemplates\csharp\code\2052

VS2010 Automatically add copyright information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.