How do I use a custom version of NAnt and resolve .NET dependencies?

I want to use a custom version of NAnt as they recently patched it due to a bug report I filed (the ]]> task now supports assembly references). I also want TeamCity to discover dependencies that my build relies on. I tried putting NUnit into the GAC but it still said it could not find it. Most likely the runner is attempting to use TeamCity's version of NUnit and it is not compatible.


: )

1 comment
Comment actions Permalink

Yes, TeamCity replaces NUnit2 task in your nant script with call to TeamCity NUnit runner. It is possible to run NUnit tests agains NUnit 2.2.10, 2.4.1, 2.4.6 and 2.4.7.

If you need using custom versions of NUnit you will have to write .config file with assembly binding redirect.

The first try could be to write .config file for all your tests assemblies. Say you have 'TestAssembly.dll' so you have to create TestAssembly.dll.config file with binding redirect. I believe that would work. So this way will help you to resolve references to NUnit dll from you library, but the runner will be taken from TeamCity.

Moreover, the second try is to create .config file for runner. Open /plugins/dotnet-plugin/bin. There are several .exe files. Create .config file for JetBrains.BuildServer.NUnitLauncher.exe. Actually, the patching can be done on the server (thus all agents will recieve it). For doing that, please make the patch inside ]]>/webapps/ROOT/update/plugins/ archive. Please make any changes in the copied file and than replace the original at the end. You do not need restaring either Server or Agents.

BTW. What issue was fixed? If you have custom build, is that possible to use the same version number as for original?


Please sign in to leave a comment.