This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
2 Replies Last post: Jul 12, 2013 4:57 PM by Gil Yoder  
Phil Kermeen Newbie 1 posts since
Jul 8, 2013
Currently Being Moderated

Jul 8, 2013 5:52 PM

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

Alex Berezoutsky JetBrains 580 posts since
Feb 18, 2011
Currently Being Moderated
Jul 10, 2013 5:48 PM in response to: Phil Kermeen
Re: Upper Limit on Lines in Code behind

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.

Thanks!

Gil Yoder Newbie 17 posts since
Apr 20, 2013
Currently Being Moderated
Jul 12, 2013 4:57 PM in response to: Phil Kermeen
Re: Upper Limit on Lines in Code behind

Phil,

 

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.

 

Gil

More Like This

  • Retrieving data ...