How to permanently disable region-folding in Visual Studio 2008

Edit: I recommend this other answer

Go to the Tools->Options menu. Go to Text Editor->C#->Advanced. Uncheck "Enter outlining mode when files open".

That will disable all outlining, including regions, for all c# code files.


The accepted answer turns off ALL code folding. If you want to disable #region folding but collapse comments, loops, methods, etc I wrote a plugin that does this for you.

Make #regions suck less (for free):

http://visualstudiogallery.msdn.microsoft.com/0ca60d35-1e02-43b7-bf59-ac7deb9afbca

  • Auto Expand regions when a file is opened
  • Optionally prevent regions from being collapsed (but still be able to collapse other code)
  • Give the #region / #end region lines a smaller, lighter background so they are less noticeable (also an option)
  • Works in C# and VB (but only in VS 2010/2012, not supported for 2008)

Region Tool Screenshot


You can also disable region-wrapping on generated code (like when you use the Visual Studio shortcut to auto-implement an interface).

alt text http://dusda.com/files/regionssuck.png