Andy @ Work

Monday, February 06, 2006

MSBuild and NAnt

At work we've been moving more and more projects from VS2003 to VS2005, and except for our initial forey into web sites (projectless web....er....projects) the journey has been relatively smooth.

Until we tried to execute our NAnt build scripts.

It appears that NAnt's task does not support VS2005 solutions. I knew this back in November but thought that the NAnt guys must be busy and would have a fix for the problem within the month.

Then came December.....January....and finally February and still the solution task does not support VS2005 solutions.

(There is a way to get it to work....and I'll post on that later once I'm happy with the solution...for the mean time read on).

I started to think that NAnt was dead. I also started to wonder if I should be porting our existing NAnt scripts over to MSBuild. There are two main reasons to do this.

1. MSBuild is packaged with VS2005, so it should be kept up to date with future versions of VS.
2. MSBuild can be used from within the IDE, making it feel more closely coupled with the development life cycle.

See my NAnt scripts are not overly complicated. In fact I think as far as the 'build' goes they are very simple, just calls the task and makes sure that the Build outputs are placed in a certain folder.

However, our build process is very SCM related. We check out, check in, label, branch, update our dependencies from other binaries in our SCM. Stuff that took me a while to write and is used frequently (especially updating dependencies to the latest release or nightly build).

So to port to MSBuild is not a trivial process.

Anyways, after all that I decided not to port but to try and get NAnt to work with VS2005. (After reading this post, I'm glad I did).

When I've polished my solution I will post it here.