Luke Girvin
Luke Girvin

Reputation: 13442

Visual Studio - comment out each line of XML

When editing an XML file in Visual Studio, I can use the shortcut Ctrl-K Ctrl-C to comment out a region of XML:

  <!--<Person>Tom</Person>
  <Person>Dick</Person>
  <Person>Harry</Person>-->

However I would like each line to be commented out individually, like so:

  <!--<Person>Tom</Person>-->
  <!--<Person>Dick</Person>-->
  <!--<Person>Harry</Person>-->

Is there a setting which will allow me to do this, or an existing Extension, or will I have to write my own macro?

Upvotes: 3

Views: 2879

Answers (2)

Thriveni
Thriveni

Reputation: 771

Just select the line/lines you want to comment and use Ctrl+ k + c in visual studio. It will comment the block in an XML file.

Upvotes: 0

Carra
Carra

Reputation: 17964

Resharper allows both edits:

  • Edit with line comment
  • Edit with block comment

Upvotes: 3

Related Questions