views:

195

answers:

2

this is really frustrating me. this problem occurs when I have a particularly large .cs file (one i'm working on at the moment has 6000 lines and many anonymous types).

I will copy a line or a part of text, and sometimes after copying several things to the clipboard, or sometimes even after the first copy, vs CPU usage shoots up to 50% and the IDE freezes for anything up to a minute, maybe longer. pasting happens immediately, no freezing.

if i end the devenv.exe task and restart it, usually the copying is good again for a couple of times until it starts freezing again.

i have a feeling the problem could be tied to intellisense trying to recalculate itself.. but why this happens when code is copied doesn't really make sense to me.

one thing i have found that if i copy text via the "select and drag & ctrl with the mouse" method, i avoid the problem. that is what led me to believe it may be something to do with the clipboard ring, or writing to the clipboard.

i have already tried:

  • SP1 installed
  • disabled antivirus
  • disabled intellisense by renaming feacp.dll (this doesn't seem to disable it at all)
  • disabled intellisense by unticking texteditor/c#/intellisense checkboxes (also doesn't seem to disable it at all)
  • disabled intellisense by unticking auto list members & parameter information (does seem to disable it)
  • ran a macro to remove all items from the clipboard ring - it removed them but the problem remained.

i must stress this only seems to happen as the code files get large, which is also usually due to having many anonymous types in the code.

i'm using Win7 x64 with 3gb RAM, however i had this problem on vista x64 too.

also, and i mean this in the nicest possible way, please don't take the refactoring approach. i do a lot of database work with large data sets so the anonymous types need to be there. it's my opinion that no matter how someone writes their code, this functionality of VS should work properly without freezing the IDE.

A: 

try this within visual studio

tools --> options --> text editor --> C#

disable Auto list members and Parameter information.

I have C# source which has more than 10,000 lines in a file and it doesnt cause any problems. Maybe its because my laptop has 4GB ram..

Andrew Keith
thanks andrew - i forgot to mention i'd tried that too, sorry!
benpage
A: 

I've come to the conclusion that it must be when one is editing massive .cs files.

I've since been working with ASP.NET MVC and haven't had this issue, and I've been using much more 'broken up' codes files.

My bad for programming design where i put 10K+ lines in a codebehind file. Yes I know, I've seen the error of my ways!

benpage