Solved

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

Posted on 2004-10-12
13
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 
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

Industry Leaders: 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!

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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