R – How to compensate for differences in environment between development machines and Build servers

buildcontinuous integrationnunit

I have NUnit installed on my machine in "C:\Program Files\NUnit 2.4.8\" but on my integration server(running CruiseControl.Net) I have it installed in "D:\Program Files\NUnit 2.4.8\". The problem is that on my development machine my NAnt build file works correctly because in the task I'm using the path "C:\Program Files\NUnit 2.4.8\bin\NUnit.Framework.dll" to add reference to the 'NUnit.Framework.dll' assembly but this same build file cannot build the file on my integration server(because the reference path is different). Do I have to have my NUnit installed at the same location as it is in my integration server? This solution seems too restrictive to me. Are there any better ones? What is the general solution to this kind of problem?

Best Answer

Typically I distribute NUnit and any other dependencies with my project, in some common location (for me that's a libs directory in the top level).

/MyApp
  /libs
    /NUnit
    /NAnt
    /etc...
  /src
    /etc...

I then just reference those libs from my application, and they're always in the same location relative to the project solution.