Jeff Key

It works on my machine

Sponsors

My Job

My stuff

Old stuff

Useful Stuff

Remove default comments in C# files

How many thousand times have you created a new C# class, then deleted the “Add constructor logic here“ and/or the default, useless XML Documentation comment?  Far too many, I'm sure.

Solving this problem is simple:  Remove them from the template that's used to generate new classes.  The file is found at the following location (VS.NET 2003):

%programfiles%\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddClassWiz\Templates\1033

Other templates are scattered around below the %programfiles%\Microsoft Visual Studio .NET 2003\VC# directory.  Simply do an in-file search for “///“ and you'll find several more.

(I think EricGu or someone else posted something about this a while ago, but I can't find the post.)

Comments

Art said:

Or create a new template. Jonathon Goodyear (angryCoder.com) wrote an article in Visual Studio Magazine maybe??? I don't quite remember. If not Visual Studio it's one of those magazines we all get.
# March 30, 2004 9:22 PM

Darrell said:

Nice.
# March 30, 2004 9:41 PM

John Sands said:

Hooray! Opening brace on the same line, the way it is MEANT to be! Thank you.
# March 30, 2004 10:04 PM

Jhai said:

coooool, thanks!
# March 30, 2004 10:54 PM

TrackBack said:

# March 30, 2004 11:04 PM

TrackBack said:

# March 30, 2004 11:08 PM

RichB said:

> Hooray! Opening brace on the same line, the way it
> is MEANT to be! Thank you.

ctrl-A-K-F

will sort this out for you.
# March 31, 2004 4:09 AM

TrackBack said:

# March 31, 2004 10:15 AM

TrackBack said:

# March 31, 2004 10:16 AM

Brendan Tompkins said:

Hi Jeff. I posted an article that steps you through how to edit these templates...

http://dotnetjunkies.com/WebLog/bsblog/archive/2004/01/12/5519.aspx
# April 2, 2004 2:12 PM

TrackBack said:

Changing Visual Studio's default project settings
# April 2, 2004 2:59 PM

TrackBack said:

# April 2, 2004 5:44 PM

TrackBack said:

# April 2, 2004 5:45 PM

Jeff Key said:

Good stuff, Brendan, thanks.
# April 3, 2004 3:23 AM

Ephedrine pills. said:

Ephedrine. Method of action of ephedrine. Ephedrine weight loss products. Health risks of ephedrine.

# July 30, 2008 3:11 AM