MSBuild file VS SLN and Project files

msbuild

I am just starting to look at MSBuild and get my head round the whole idea. I have setup a CI Server with Hudson and want to know how I "should" deal with build scripts and the sln / proj files.

For example I have an existing solution that has 10 projects in it, (one being a website and another being the web deployment project, and the setup MSI project). What is a good way of dealing with the building of this?

  1. should I just point msbuild at the sln file?
  2. Should I take what is in the SLN file and create another, so it points at the different proj files?
  3. Should I take the code from all the sln and proj files and create one custom build script?

If I do either of the last two, do I have to worry about maintaining two sets of scripts, i.e. making sure my script is upto date as well as the sln / proj files?

Also how do I deal with building it when developing on my local box? Do I just CTRL SHIFT B to build it and then only use the build script for the CI server / deployment builds?

Best Answer

I tend to like the approach of, each project has it's own build file (whether it be msbuild or NAnt etc) and then there is a master build which builds all projects. That way you focus on project (eg while fixing a bug) and you run the master build before checking in plus the master.build is what gets run on the build machine.

You would still build and debug normally within VS, the build scripts are separate. The build scripts would be only for the build box and for running before checking in.

That's just my take on things. You may find my posting on getting started with CI useful...

Good luck!