Add current date and PC username when a class is created in Visual Studio

253 Views Asked by At

Is it possible to add creation date and username when a *.cs file is created in Visual Studio like IntelliJ IDEA do?

For example:

//Created by Tamerlan, 9.28.2016 11:00  <- add this line automatically
public class MyNewClass
{
}
1

There are 1 best solutions below

0
Andy Lamb On BEST ANSWER

Yes, you can create an item template for C# classes and use parameter substitution. Username, date, and time are available as pre-defined substitutions.

https://msdn.microsoft.com/en-us/library/eehb4faa(v=vs.140).aspx

Although possible, source control makes this redundant. In my opinion.