When you have a pretty large web site in Visual Studio 2005, the
site build time grows dramatically and it becomes very difficult to
change code and then hit F5 (or Ctrl+Shift+B) in order to see if
the project builds properly or not. In Pageflakes, we have a giant web
site. It takes so long to build the site that we generally issue
the build command, go to kitchen and make a cup of tea, drink it,
come back and see the site still building. Generally when we do
this 20 to 30 times per day, we start feeling sick (not
because of VS 2005 instead of too much tea).
Here’s a cool idea we tried. You can make
folders hidden by going to Windows Explorer, go to Folder
properties, check mark “Hidden” and click OK and then select “Apply
to current item only”. This will make the folder hidden and the
folder will disappear from Windows Explorer unless you have turned
on the option to show hidden files and folders. You will also see
the folders disappeared from Visual Studio. Now we use Total
Commander instead of Windows Explorer so hidden folders are not a
problem to us. Bascially none of us remember anymore how to use
Windows Explorer because we are so used to Total Commander now. Try it, it will
change your life.
When you make folders hidden, Visual Studio will not build them!
So you can make App_Data, App_Themes, images, stylesheets,
javascripts, html files hidden and Visual Studio will skip them.
Around 70% of our web site is non C# code. So, we gained dramatical
reduction in web site build time by trying this idea. Another idea
is to move all classes from App_Code to external DLL project. Thus
they will build once and VS will not build them again and again if
you make some changes in some codebehind file or some .aspx or
.ascx file. This will also give you significant build time
reduction.
Of course you can turn off Build Website and use Build Page
option. But that does not help. We want to ensure the web site code
is not broken due to any change. So, we need Build Website
option.