Edit>Outlining>Collapse to Definitions no long works for #region . . . #endregion blocks in VS 2017


  • In Visual Studio 2017 RTM, Edit>Outlining>Collapse to Definitions command (Ctrl+M, O) no longer works with #region - #endregion blocks. What's even worse is that even after you scroll through the document to hunt down all the regions and collapse them manually the next time you use the command it actually expands all the regions all over again. How does it make any sense for a Collapse command to expand anything?

    Anyone aware of some way to get Collapse to Definitions (Ctrl+M, O) work with #region #endregion blocks in Visual Studio 2017 RTM?

    Wednesday, March 08, 2017 12:51 AM

All replies


    In Tools\Options\Text Editor\C#\Advanced, there is an option to enable collapsing regions as part of definitions.

    Wednesday, March 08, 2017 2:44 AM
  • Hi Netizen K,

    Welcome to the MSDN forum.

    I'm so glad to hear that your issue is solved and thank you for your sharing, it will help other community members who meet the same issue.

    BTW, could you please mark your reply as answer and other community members can easier search this useful information, thank you for your understanding :)

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Thursday, March 09, 2017 1:43 AM