Omar AL Zabir blog on ASP.NET Ajax and .NET 3.5

Working hard to enrich millions of peoples' lives

Sponsors

Reduce large website build time in Visual Studio 2005

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.

Posted: Oct 31 2007, 08:48 PM by oazabir | with 9 comment(s)
Filed under:

Comments

Rama Katta said:

Thank you very much for interesting suggestions. Will try.

# October 31, 2007 11:34 AM

Fabrice Marguerie said:

Well, you forgot that another option is to use the standard Web Application project model, which has many less problems that the VS 2005 Web Site project model!

# October 31, 2007 1:28 PM

Chua Wen Ching said:

Interesting tip. Thanks Omar.

# November 1, 2007 3:14 AM

KAmran Shahid said:

Shouldn't this be a part of the IDE itself ?

# November 1, 2007 3:29 AM

Vika said:

Try ALT-F4 , it's even quicker than Ctrl-Shift-B

# November 1, 2007 12:02 PM

Eric said:

I tried your approach and the problem is that now IE complains that a javascript is not available.

# December 4, 2007 2:02 PM

Pradeep said:

Doesn't  right click on the folder in Visual Studio IDE and Exclude from project work the similar way? Please let me know.

# February 7, 2008 4:42 PM

anas said:

Thank you very much , I was workign with rainbow portal version , and the Building process was taking very long time , but after i make the Desktopmodules and aspnet_Client folders hidden , the build process now doesn't takes a seconds...

I can't believe it.. why is that happened ?

I was trying to paly with BuoldProviders in web.config to exlude the folders, but i realized that its helpful to exclude a files with some extension...

is there any thing that can be set in web.config to tell the Visual studio to ignore some Folders ? of course I mean for website and not WAP ..

Thanks again...

# May 11, 2008 9:57 AM

wbrproductions said:

Great, simple trick. Worked great. Thanks much!

# September 23, 2008 6:06 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)