Upper Limit on Lines in Code behind

Is there an upper limit on the number of lines in a code behind that Resharper can handle? I've inherited a nasty 12000 line 'special' that makes devenv.exe (vs2012) go pop. When i suspend Resharper i can review the doc. Best way to refactor? I don't have time to do it properly. Using 7.1

Comment actions Permalink

Hi Phil,

ReSharper does not have any strict limit for filesize, though ReSharper may act slow on big files. By 'go pop' you mean the VS slowdown and performance degradation?

Please let me know.

Comment actions Permalink


You might consider dividing the file up into multiple files. If the file has only one class, it could be divided into partial class files. Otherwise extracting each class and putting that in a file should be possible. It could be done with a simple console app that read in the lines top down, and split the file between classes or class members, and then adding whatever was needed to wrap those sections with namespace parameters, imports, class headings, etc.

Alternatively a good text processor like Notepad++ might be able to read the file without going "pop," and the spliting could be done manually. I'd go the first route personally, but that's a matter of choice.



Please sign in to leave a comment.