visual studio copy to clipboard IDE freezes
Asked Answered
P

3

12

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.

Potentate answered 14/10, 2009 at 0:55 Comment(1)
Which version of VS.Net are you using?Milieu
P
0

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!

Potentate answered 18/2, 2010 at 23:58 Comment(2)
What about CSS files? Mine are fairly small, the largest being 99 lines long. I am trying to update the themes for the National Federation of the Blind's website, but whenever I paste a new gradient code from either ColorZilla's Gradient Editor or the completed Black and White theme of the website, Visual Studio 2015 freezes and stops working.Gum
I humbly disagree with that assessment. I came here searching for a solution because this is happening while editing a 50 line C# file, the only .cs file in this brand new console application. (Jeez, I just saw this post is 10 years old.. still the first link for me on Google for the search, though. Wish it were an actual solution.) :/Union
C
1

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..

Cuddy answered 14/10, 2009 at 1:1 Comment(1)
thanks andrew - i forgot to mention i'd tried that too, sorry!Potentate
A
1

I've got this again in VS2022 no matter the file size from which I was trying to copy or how much text I was copying.

The only thing that worked was deleting the .vs folder and reopening the solution.

I've tried updating, repairing and even installing a different version of VS (enterprise, professional), disabling extensions and nothing seemed to work. Then I've realized that if I was recloning the repositories, it was working, which allowed me to narrow the issue down to the .vs folder.

Aristocrat answered 2/10, 2023 at 12:45 Comment(0)
P
0

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!

Potentate answered 18/2, 2010 at 23:58 Comment(2)
What about CSS files? Mine are fairly small, the largest being 99 lines long. I am trying to update the themes for the National Federation of the Blind's website, but whenever I paste a new gradient code from either ColorZilla's Gradient Editor or the completed Black and White theme of the website, Visual Studio 2015 freezes and stops working.Gum
I humbly disagree with that assessment. I came here searching for a solution because this is happening while editing a 50 line C# file, the only .cs file in this brand new console application. (Jeez, I just saw this post is 10 years old.. still the first link for me on Google for the search, though. Wish it were an actual solution.) :/Union

© 2022 - 2024 — McMap. All rights reserved.