views:

20

answers:

1

If you are coding C# inside visual studio, and you have a multiline comment, thusly:

/*
This is a very interesting comment
that consists of multiple lines
*/

Then if you are inside the comment, like after the word "comment" in my example, and you hit enter, Visual Studio adds a "* " on the new line and places your cursor even with the "*" that started the comment.

I hate this behavior. It is never what I want. Any way to turn it off? I wandered through the editor options but I couldn't find it.

+2  A: 

Strangely enough this behavior is tied to XML doc comment generation in the C# editor. If you disable XML doc comment generation it will also disable the auto-generation of the * in multi-line comments

  • Tools -> Options
  • Text Editor -> C# -> Advanced
  • Uncheck "Generate XML doc comments ..."
JaredPar
Ew. That is weird. I don't want to get rid of XML doc comments. I guess I'm stuck. Thanks for the info.
jkohlhepp
+1 for being the carrier of obtuse knowledge. I expected this question would go unanswered. Kudos.
Tergiver
@Tergiver strangely you'll find other behaviors are tied to this option in both VB and C# (in VB toggling this option can alter intellisense behavior).
JaredPar