Solved

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

Posted on 2004-10-12
13
319 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 69

Expert Comment

by:Éric Moreau
ID: 12286088
Have you disabled Dynamic Help?
0
 
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 69

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
(code works) but print excel in Landscape 5 49
C# Reverse int in fast ways 6 27
Image(7) 1 36
cs.Designer Issue(2) 2 19
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now