Solved

Editing C# code in Visual Studio .NET has gotten slower and slower

Posted on 2004-10-12
13
339 Views
Last Modified: 2010-04-15
Editing C# code in Visual Studio .NET has gotten slower and slower as the size of my solution has increased. It obvious that this is because of all the real time error checking that occurs as you add and delete source lines. As I change code I can see the CPU utilization spike up to 100% until the error checking cycle is complete and the new blue squiggles are updated in the editor.

How can I change its preferences for "error checking while I am typing"?
Is there any solution for this problem using SP or Update Patch?

I've experienced the same with VS .NET 2002 and VS .NET 2003.

Thanks
-FA
0
Comment
Question by:Farzad Akbarnejad
  • 5
  • 2
  • 2
  • +4
13 Comments
 
LVL 3

Expert Comment

by:skpatra
ID: 12286008
This one may help you speed up things a bit:

1. Do not keep too many files open in your solution.
2. If you have an ASP.Net project, I have got things to speed up by running iisreset from time to time.
3. Go to Tools > Options > Text Editor > (your development language) > Formatting. Also checkout Tools > Options > Text Editor > All Languages > Formatting. You can manipulate the options here.

I have not verified if these are valid solutions. But I do seem to get things working a bit faster with these steps. Hope this helps you too...
0
 
LVL 14

Author Comment

by:Farzad Akbarnejad
ID: 12286071
Hello skpatra,
Thanks for your fast replying.
I am working on an existing C# project in a company. It have many files and have a frmMain files that has 65500 lines of code!!!. I must continue this project. Although we define a new project and rewrite th application from start but we must support this large solution project and add or remove code from it. So loading a few open files in solution couldn't help me because frmMain is very very huge.

I couldn't find proper options in Tools > Options > .......   for diabling error checking. What option I must change exactly.

Thanks
-FA
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12286088
Have you disabled Dynamic Help?
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 20

Expert Comment

by:TheAvenger
ID: 12286882
What skpatra meant was to have less files open in the editor. You can still have them in the solution.

Why don't you try to split this huge form into several files? It should be relatively easy.

I don't know how big your solution is, but I have a solution with 35 projects inside it, a total code of about 150-200 thousand lines and the VS performs perfectly. However I have no such huge files. What is your machine btw?

And try to delete the .ncb files from your solution folders (close VS before that). They contain IntelliSense info and may habe become corrupt or too big.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12287262
Isn't the .ncb file for C++ projects only?
0
 
LVL 14

Author Comment

by:Farzad Akbarnejad
ID: 12287326
TheAvenger,
my frmMain.cs file has 65000 lines of code. It is one file. I can't split it. I musn't modify project. I must only support it and fix some bugs of it.

emoreau,
I will test your solution and come back soon.

Thanks
-FA
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 12287361
Hmm, maybe the .ncb is c++ only...

FarzadA: well, if this file causes the problem, you will either have to change it or leave with the speed :-(( Try the solution from emoreau and see what happends...
0
 
LVL 14

Author Comment

by:Farzad Akbarnejad
ID: 12289281
Hello,
emoreau,
I tested your solutions and they didn't help me. .ncb files are only for Visual C++ Project. I am using C# and haven't any .ncb file.

Where I can find option for disabling error checking while typing capability? I couldn't dins this option in Options dialog box!

Thanks
-FA
0
 
LVL 8

Expert Comment

by:Razzie_
ID: 12306814
How much RAM do you have in that pc? More RAM makes a lot of difference.
0
 
LVL 4

Accepted Solution

by:
Farshid-Zaker earned 500 total points
ID: 12306964
Hello Farzad,
The best way to solve your problem is creating a copy of your C# file and change its extension from .cs to .txt for example. Include this file in your project and change the Build Action of it (in Properties pane) to Compile. (It should be content for a text file) Remove the original .cs file from the project and work with the .txt file. This would solve your problem. When you finished developing, you can change the .txt file to .cs again. I have tested this solution for a 70000 lines .cs file and worked well.

note: VS.NET assumes that always it should format the known languages code. So, you can not force it to do nothing with a .cs file. But you can change your file type for a short time!

Farshid
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 12309176
You can also right-click he file and choose "Open With". Then instead of the default CSharp-Editor, take the XML/HTML-Editor. You'll loose syntax highlighting and intellisense, but the speed should be much better.
0
 
LVL 14

Author Comment

by:Farzad Akbarnejad
ID: 12311695
Razzie,
512 MB RAM with Intel 600 MHz CPU.

Farshid-Zaker,
I will test your silution 3 next days and will come back.

AvonWyss,
I need Intellisense but I want to disable "HighLighting Error"

Thanks
-FA
0
 
LVL 14

Author Comment

by:Farzad Akbarnejad
ID: 12332098
Hello,
I think that Farshid-Zaker wrote the best solution. I haven't Intellisense or colored syntax but it works fine and easy.

Thank
-FA
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question