views:

934

answers:

5

I am having severe performance issues when compiling a moderately large ASP.Net website in Visual Studio 2008 (targeting .Net 3.5). I know there are some tips & registry hacks for improving compilation performance in VS 2005, are there any for VS 2008? Specifically, it seems that VS 2008 is compiling the whole website every time F5 is hit, even when no files have changed in that project since the last compile, or perhaps there is some way to skip the validation stage?

A: 

I'm guessing this is an ASP.Net Website project and not an ASP.Net Web Application project. You'll get better compile performance from a Web Application project so you might consider converting it.

For a Website project, you can open the Website in Visual Studio, right click the web site project node in the Solution Explorer and click Properties. When the dialog box opens, click the Build item and set the item labeled "Before Running Startup Page" to "No Build" or "Build Page". This will prevent Visual Studio from compiling all the pages in your site and improve your local development experience at the cost of reduced compilation. Probably a worthy trade-off in your case.

AndrewDotHay
A: 

If you have a lot of stuff in App_Code, you may want to move (some of) it to a seperate assembly.

Try renaming your .suo file

Watch out for Dueling Assemblies (where was this article when I was having the problem =) ?), one bad reference was killing me before. I noticed this and other potential problems by looking at the output window during the build process.

StingyJack
+2  A: 
  • Antivirus problems: Make sure that your Antivirus program excludes your project directories! Make sure that your Microsoft.NET directory inside of your Windows directory is also on the exclusion list.

  • IIS vs. "Cassini" : If you can, use IIS instead of VS's integrated web server (aka "Cassini"). Doing this will prevent the server from having to restart every time you run.

  • Memory: Do you have enough?

Dave Markle
+1 for mentioning the antivirus
orip
A: 

.Net 3.5 Service Pack 1 made some big performance gains at least in terms of the IDE and switching from Code to Design view. I don't know if it affects the general compilation speed, but it is worth applying if you've not yet.

Steven Behnke
A: 

My Visual Studio 2008 is not creating PDB files when building a c# website... However, It is definitely in Debug mode.

Any ideas?