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?
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.