• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

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

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
Farzad Akbarnejad
Asked:
Farzad Akbarnejad
  • 5
  • 2
  • 2
  • +4
1 Solution
 
skpatraCommented:
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
 
Farzad AkbarnejadAuthor Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
Have you disabled Dynamic Help?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TheAvengerCommented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
Isn't the .ncb file for C++ projects only?
0
 
Farzad AkbarnejadAuthor Commented:
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
 
TheAvengerCommented:
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
 
Farzad AkbarnejadAuthor Commented:
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
 
Razzie_Commented:
How much RAM do you have in that pc? More RAM makes a lot of difference.
0
 
Farshid-ZakerCommented:
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
 
AvonWyssCommented:
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
 
Farzad AkbarnejadAuthor Commented:
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
 
Farzad AkbarnejadAuthor Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now