Visual Studio Block "C-Style" Comments: Incredible Annoyance Solved!

Published on
10,285 Points
1 Endorsement
Last Modified:
If you have ever tried to use "C-style" or "block" comments in recent versions of Visual Studio, undoubtedly you have been annoyed. C-style comments look like this:

Some long-winded comments in here.

But Microsoft makes it irritating for you to create this type of comment, because, by default, when you try to do it, VS tries to second-guess you and screws up your commenting. It does this to you:

* /

In summary, each time you hit enter after a c-style comment, VS puts an asterisk at the start of each line, and then when you try to put the end tag, it makes a space between the asterisk and the forward-slash, which defeats the commenting and forces you to manually go back and clean up.

I cursed about this "feature" for years until I recently found a simple solution:

In Visual Studio 2010 (and I believe this works for older versions as well) do the following:

Click Tools, Options, Text Editor, C#, Advanced -->  UNCHECK "Generate XML documentation comments for ///".

After you do this, the first time you try block comments and VS doesn't maliciously hose up your comment tags, you might shout for joy, sing, or some other such outburst.

Incidentally, there are some other Visual Studio settings that are a must-have for me:

Startup - Under Tools, Options, Environment, Startup, you can set VS to not do anything upon startup. Not load the annoying content, etc. Just startup and be ready.
Track Active Item in Solution Explorer - By default VS doesn't highlight the file in Solution Explorer while you're currently in that file in the editor. To change that, go into Tools, Options, Projects and Solutions, Track Active Item in Solution Explorer
Delete all breakpoints - I work with breakpoints a lot and often like to delete all of them with one fell swoop. This can be done with CTRL-SHIFT-F9. But there's an annoying prompt that asks if you're SURE you want to delete all these breakpoints. Get rid of the prompt by going to Tools, Options, Debugging, General - UNcheck "Ask before deleting all breakpoints".

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Join & Write a Comment

In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Discover the basics of using Outlook 2016 from office 365.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month