Strange Error in nunit runner on TC v6

TC Version: Enterprise 6. (15772)
VCS: TFS 2008
Agent OS: Windows Server (32bit)
db: Sql server 2008

We are looking to upgrade to 6 from 5.1.2.
So to test, we made a copy of our TC database and then copied the TC settings over. verified that all the builds ran correctly. Then ran the 6.0 install/update. Install ran fine, The one agent we are using for testing upgraded fine.
However we now get the following error on any nunit build:

[Step 2/2] Error while running NUnit tests from assembly E:\BuildAgent\work\aa7904aa81d1de5f\Libraries\Tests\IDT.Sherman.Manufacturing.Tests\bin\Debug\IDT.Sherman.Manufacturing.dll: Unable to find assembly 'IDT.Data, Version=, Culture=neutral, PublicKeyToken=null'.
Check correct .NET Framework version and process platform (x64, x86, MSIL) are used both in the test runner settings and involved assemblies on this machine.
[14:14:01]: [Step 2/2] NUnit Error: System.Runtime.Serialization.SerializationException: Unable to find assembly 'IDT.Data, Version=, Culture=neutral, PublicKeyToken=null'.

The specified dll is in the location specified in the error message and is the right version.
This error is thrown as soon as the first nunit test is started and then repeatedly thrown for every test assembly.
The interesting thing is that the runner continues on and actually processes all the tests in those assemblies correctly (63: ignored, 457: passed).
So it seems to me that this maybe an incorrect error.

Anyone have any ideas on how to get by this?

Comment actions Permalink

Please check .NET Framework version and bitness (i.e. x86 or x64) were selected right. The same error message may be caused by COM/native references that were failed to be resolved.

How do you run NUnit tests?

Comment actions Permalink

  Target Framework .net 4
  Platform Any CPU

nunit .net runtime set to auto, version 4

I've tried both the nunit 2.5 and 2.5.8

There is no COM code involved in the tests or the projects.

The assembly that the error message says it cannot find (IDT.Data) is also targeted at .net4 any cpu.

I just verified that by running corflags on it and geting
PE: PE32

32BIT: 0

I have the nunit runner set up as the second build step. The first was to build the project with the vs 2010 runner.

Our production TC server builds this fine using nunit 2.5 as part of the vs 2010 build runner.

Nunit build step.png
Comment actions Permalink

Please check the lost assembly is available in the tests assemblies folder. Try running it under x84 locally.
Could you try if the tests run on the build on the build agent machine under the same account on the same folder.

Comment actions Permalink

It appears to be an issue in how the test dlls are designated.
In the Run Tests from entry,
If I use .\Libraries\Tests\**\*.dll
I get the error.
However if I specify the test dlls like


Everything works fine

Comment actions Permalink


With ** wildcard NUnit may be started for files in \obj\ directory and fail the same way. I don't see it the error you provided, but try to add Libraries\Tests\**\obj\debug\*.dll to exclude list.
If that doesn't help, please post a full build log - here or to teamcity-feedback[]


Comment actions Permalink

Getting the same error.
I attached the complete log.


Comment actions Permalink

We found several related exceptions in NUnit tests run.
Please check if this applies to your case.

Does the tests on Libraries\Tests\IDT.Sherman.Manufacturing.Tests\bin\Debug\IDT.Core.UnitTesting.dll

passes on the build agent machine from the same folder under the same user account in NUnit-Console.exe

I also noticed, you collect .NET Code Coverage information. Could you please try running the build without .NET coverage.

Please disable 'Run Recently Failed Tests First' feature.

Please sign in to leave a comment.