Automating ASP.NET building with NAnt

In my drive to sort out my development processes there are a few things I want to do. Top of my list is proper automated testing and creating automatic documentation.

Doing these steps every time I compile my site (or application) will add a lot more steps, so I thought it would be better to learn how to automate the build process first.

I'd heard that NAnt was the tool I should be using, but I found it a little bit overwhelming.

NAnt is a program that follows a list of instructions in an XML file called a build file. These instructions are used to do a series of tasks like the following:

  • Compile a site's ASP.NET code behind files
  • Compile some unit tests
  • Copy some files
  • Run the unit tests
  • Run a program to create documents

It took me a while to get my head round it, but I finally got a simple build file working.

Next I'm going to get the testing working and then automate it using NAnt.

David J said

I've just finished co-writing some Selenium scripts in C# and the next step is using Nant / Cruise Control so I'll let you know how it goes :)

Richard Garside said

Selenium sounds incredibly useful. Shame we didn't know about it when we did the Pensions Credit Calculator all those moons ago. I'll have to try and get some Selenium tests working to test the log in and comment leaving parts of this blog.