Sigh!
After all yesterday’s work, I came back in this morning to find that yes – hoorah, the project had built successfully on the build server.
But oh no! It no longer built on my machine! Not surprising I guess as I spent so much time trying so many things.
The error I got was:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'nunit-console-runner, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified.
File name: 'nunit-console-runner, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' at NUnit.ConsoleRunner.Class1.Main(String[] args)
Retracing my steps I found that I had modified the nunit-console.exe.config (found in the nunit \bin\net-2.0 directory).
I had added a supportedRuntime tag:
</startup><supportedRuntime version="v2.0.50727"/></startup>
I removed this and everything is hunky dory again.
If you are getting this error then take a look at that setting. I hope that helps.