VS 2010: disable Fileheader for new class files

I recently noticed that Visual Studio 2010 (Professional) automatically inserts FileHeader into new class files. I do not know when it started, but some time ago it was not included. In addition, since then using directives have been added after the namespace.

This is what the file looks like after generation:

// ----------------------------------------------------------------------- // <copyright file="Class1.cs" company="Microsoft"> // TODO: Update copyright text. // </copyright> // ----------------------------------------------------------------------- namespace MyNamespace { using System; using System.Collections.Generic; using System.Linq; using System.Text; /// <summary> /// TODO: Update summary. /// </summary> public class Class1 { } } 

And this is how it should look (and how I want it):

 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MyNamespace { public class Class1 { } } 

I disabled all extensions and all plugins, but the problem remains. I hope someone can explain to me how to restore the previous behavior.

Thanks in advance

+8
visual-studio-2010
source share
3 answers

Visual Studio uses templates to create new files. You can read about how to create your own templates here http://stevesmithblog.com/blog/how-to-fix-visual-studio-file-templates/ . The default templates are usually stored in the C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ ItemTemplates files, and you want to change them if you want to replace the format globally.

+6
source share

For me, the file headers appeared after installing Resharper and Stylecop .

To get rid of them, I turned off the inclusion of headers in the Resharper section (section "Clearing the code"), and also made sure that the file header rules no longer apply in Stylecop . Then I modified the file template styles mentioned earlier. And finally, I had to run devenv.exe / installvstemplates from the command line for Visual Studio to register the changes.

+1
source share

All Articles