This project has moved. For the latest updates, please go here.

License Header Definitions

The actual license headers are defined in .licenseheader files. You can add such a file to you project by right-clicking on the project in the solution explorer and selecting Add New License Header Definition File To Project in the License Headers sub menu. You can also add an existing file which can be useful if you want to share your license header definitions between projects.

The structure of the file is quite simple:

It starts with the keyword extensions: followed by a list of file extensions (separated by whitespaces). Everything below this line until the next line starting with extensions: will be inserted into the files with the given extensions.

For example

extensions: .cs 
#region copyright
// This is a sample license header.
#endregion
extensions: .aspx .ascx
<%-- This is a sample license header. --%>
will insert the text

#region copyright
// This is a sample license header.
#endregion
into .cs files and

<%-- This is a sample license header. --%>
into .aspx and .ascx files.

If you don't want license headers in the code-behind files of your ASP pages and controls, use the following license header definition (which inserts an empty header in the code-behind files):

extensions: .aspx.cs .ascx.cs 
extensions: .cs 
#region copyright
// This is a sample license header.
#endregion
extensions: .aspx .ascx
<%-- This is a sample license header. --%>


See also Expandable Properties.

Last edited Dec 23, 2011 at 9:50 AM by FabianSchmied, version 6

Comments

binodnp Aug 20, 2014 at 3:33 PM 
The problem is that there is no way to add directories in an "exception list". As we have a lot of javascript in our project, this is polluting other frameworks by adding a new copyright information. It's dangerous!