Having TC run with a different version of NUnit

Hi - I am using TeamCity 3.0.1 (build 6010) and I am attempting to have TC run my unit tests.

I am using the sln2005 build runner to build my solution which contains a few projects, one of which is an nunit project. When TC is to execute the unit tests it complains about not being able to load a specific version of NUnit while flagging the build is broken. However, the unit tests are still being run.

Here is something from my build log:

: [Target "...] Failure executing test(s). If you assembly is not built using NUnit version 2.2.8.0, then ensure you have redirected assembly bindings. Consult the documentation of the ]]> task for more information.
: [Target "....] Could not load file or assembly 'nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. Den angivne fil blev ikke fundet.

Looking into the TeamCity installation folder I can see that nunit.framework.dll version 2.2.8.0 is located there, whereas version 2.4.3.0 which my project is building with is located in my program files directory.

I would like to have TC run with my the correct version of nunit and avoid having the build marked as broken. Does anyone have any ideas how can I fix this?

Thomas

2 comments

Hello Thomas,

Please watch http://www.jetbrains.net/jira/browse/TW-4237

Thanks!
--
Eugene Petrenko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi - I am using TeamCity 3.0.1 (build 6010) and I am attempting to
have TC run my unit tests.

I am using the sln2005 build runner to build my solution which
contains a few projects, one of which is an nunit project. When TC is
to execute the unit tests it complains about not being able to load a
specific version of NUnit while flagging the build is broken. However,
the unit tests are still being run.

Here is something from my build log:

: [Target "...] Failure executing test(s). If you assembly
is not built using NUnit version 2.2.8.0, then ensure you have
redirected assembly bindings. Consult the documentation of the
<nunit2> task for more information.

: [Target "....] Could not load file or assembly
'nunit.framework, Version=2.4.3.0, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. Den
angivne fil blev ikke fundet.

Looking into the TeamCity installation folder I can see that
nunit.framework.dll version 2.2.8.0 is located there, whereas version
2.4.3.0 which my project is building with is located in my program
files directory.

I would like to have TC run with my the correct version of nunit and
avoid having the build marked as broken. Does anyone have any ideas
how can I fix this?

Thomas



0

I apologize for not having a concrete example to show you but I moved my build to Ant and wiped my setup with NANT.

You should be able to use a bind redirect to fix your issue. Basically you need to add some configuration in NAnt to something like:
]]>

Doing this I was able to use the latest version of NUnit with NAnt and had TeamCity running the NAnt script and running my tests.

See for details.
http://nant.sourceforge.net/release/latest/help/tasks/nunit2.html


Sorry this is so vague, but I was able to get it to work. Hope this helps.

Bob

0

Please sign in to leave a comment.