Scott Guthrie talks about how to speed up build times for Visual Studio 2005.. It's a great read, and definitely something to know inside and out if you're doing ASP.NET development with VS 2005. You've got to hand it to a person in his position doing down and dirty blog posts to help us little guys out, from what I hear and from recent personal experience, he's very accessible.
In his post about build performance, he actually has a good nugget of wisdom about overall performance of the IDE as well. He mentions this:
Keep the number of files in your /app_code
directory small. If you end up having a lot of class files within this
directory, I'd recommend you instead add a separate class library
project to your VS solution and move these classes within that instead
since class library projects compile faster than compiling classes
using the /app_code directory.
This will speed build time, but will also speed up your design time experience as well. Why you ask?
I recently spent some time on the phone with Bradley Bartz from MS, who explained this very slowly and patiently to me. I hope he'll let me know if this isn't right, but from my understanding, Every time you make a change to a file in the App_Code directory, this invalidates the Visual Studio's internal cache of classes in this folder. The very next time you try to open a designer for an ASPX page or ASCX control, VS has to re-compile this folder to get the metadata it needs for the design-time rendering of the control. This can cause the IDE to slow to a crawl. One the classes are cached, things speed up significantly in the IDE.
This was a big eye opener for me. I'd been using the App_Code folder as an easy way to get a globally accessible class in my web projects. If it was stuff that only was related to the current web site, I felt this was a good choice for where to put the code. The problem was, I was banging up against this slowness all the time. I'd get some class designed, tab over to a page or control to do some databinding and find myself waiting in frustration, my development rhythm shot. Little did I know that I was waiting on a compilation of the entire App_Code folder.
So, I'm going to seriously wean myself off of this folder, in favor of a separate dll project for these situations where I need a class to be visible across controls or pages.
09-22-2006 1:28 PM