Wednesday, October 17, 2012

Adding regions to your xml files in Visual Studio

Most of the website we maintain and develop at Telerik, needs the ability to redirects urls. Because of this, there are lots of legacy urls and the files that describe those redirects quickly get enormous (thousand of lines). Unfortunately, Visual Studio doesn't gives you the option to organize xml documents into regions as with the c# files.

Luckily, I stumbled upon a very useful extension for Visual Studio that does exactly this. It is presented as tool for organizing XAML files, but actually it deals with every xml document. I already tried it and it works great with both VS 2010 and VS 2012.

The syntax is pretty much the same as we know it:
<!-- #Region Some Useful Label here -->
//your xml document
<!-- #EndRegion -->

Check it out: or grab it from Visual Studio gallery. Big Thanks to the author Jacob Johnston!