views:

273

answers:

2

We have a web application project (not a web site), until the day we have added batch="false" to web.config web development server was compiling all the web application instead of the page that was requested.

<compilation debug="true" batch="false">
      <assemblies>
        ...
      </assemblies>
</compilation>

This make us faster. But I don't know what changed (I have inspected both foo.cproj and web.config from repository, comparing older versions but find nothing can cause this slowness).

I looked at %temp%/Temporary ASP.NET Files; after I compile my web app (not recompile, shift + f6), then I request a page and I see that web server deletes all of already compiled files from %temp%/Temporary ASP.NET Files and recreates. I don't know if this is normal but it seemed to me a full recompilation of all web app, which is very slow. (I looked via process explorer to wevdev.wevserver.exe it calls csc.exe several times)

How can I can make compilation faster? Thanks...

A: 

There is an option for ASP.NET Development Server named 'Enable Edit and Continue' that is available with the 32-bit version of NET CLR. Turn that off in Visual Studio.

Also, try changing the build for 'Any CPU' in a build for 'x86'. That should make compilation faster.

Patrick de Kleijn
+1  A: 

I believe this is a part of using the Web Application Project. Any time you build your application, the entire site is recompiled. You should see that unlike a 'Web Site', the web application all compiles down to a single dll (plus references).

Another thing you have to watch out for is any time you delete a file/folder under your root web app folder it will also force a recompile, which can be a real pain in the butt for temporary files.

On the plus side once you get over the first compile, there will be no additional waiting for compile times on unvisited pages.

Corey Downie