How to continue using NAnt with ASP.NET 2.0 – level 300

First, if you aren’t using NAnt for team builds in ASP.NET 1.1, shame on you.  Do that first.  When converting to Whidbey, you’ll notice that your website no longer compiles to a single assembly and that multiple assemblies are created at JIT time.  This poses a small problem to the way we are used to scripting web application builds.

You DO NOT want to copy everything in  your website to your production server.  There is no need for your code files to be out there.  Instead, you will want your NAnt script to build the whole website and deploy the binaries.  The solution task won’t work for  you with a VS 8 solution.  You’ll need to use an <exec /> target and kick of aspnet_compiler to precompile your web app to a stage folder and them use a <copy /> target to kick the files out to your server. 

MsBuild does provide an AspNetCompiler task to do this, but it just kicks off aspnet_compiler.  MsBuild is still just a subset of NAnt, so I think it’ll be a while before it can compete effectively (unless we find some proprietary stuff that we _really_ need).