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
LVL 14
Farzad AkbarnejadDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
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 AkbarnejadDeveloperAuthor 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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
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 AkbarnejadDeveloperAuthor 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 AkbarnejadDeveloperAuthor 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.