Cook Computing

Visual Studio Guidelines

July 20, 2005 Written by Charles Cook

I saw Sara Ford's post last week and was meaning to blog about it, then was reminded when I saw Craig Andera's post, the topic being the guidelines feature in Visual Studio which is very useful if you have a fetish about code line length. When configured this feature displays one or more vertical guide lines in VS edit windows (see above posts for snapshots of what it looks like). I always code to a max line length of 80 columns and so I now use the following settings:

For VS2003:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\Text Editor
REG_SZ value "Guides"="RGB(128,0,0) 80"

For VS2005:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor
REG_SZ value "Guides"="RGB(128,0,0) 80"

This places the guideline between columns 80 and 81.

One caveat: according to a comment by Sara on her own post:

It will work on Visual Studio .NET 2003 and should work on Visual Studio .NET 2002, but use at your own risk on either. I tested that it does work on 2003, but very little, so i can't ensure product stability using guidelines there. And i have *not* tested it at all on 2002, but the notes i have say it should work there.

If you encounter an issue on any version, let me know.