C # # region / # mismatch endregion

Does anyone know a good way to find out where I have an extra #region or #endregion in my code? I have about 5,000 lines of C # code, and I'm trying to do it manually right now. Any help is appreciated.

+3
source share
4 answers

Do CTRL+ M CTRL+ L- to close all regions. Then expand them one at a time on the left (small sign +) until you see #region XXXwhich one does not have a match#endregion

It should look like this:

Inconsistency http://i51.tinypic.com/j92at5.jpg

+8
source

Ctrl+M, M, . , , , .

+1

, , ?

CTRL + M CTRL + O -

He must collapse everything except the area with the mismatch.

+1
source

I just had this problem,

The easiest way to find out where I deleted endregion is to compare with the last file in the source control.

the line was highlighted and easy to find.

+1
source

All Articles