Teamcity NUnitLauncher.net 4

Using TeamCity 6.5.1
NUnit Version 2.5.10
Win2008 x64

The project uses .NET 4.0

Trying to run TeamCity NUnit's built-in test runner, I get the following error:

NUnit startup errors in 'E: \ TeamCity \ LocalBuildAgent \ BuildAgent \ work \ 698a8f459eac8cd9 \ MyProject \ bin \ Release \ MyProject.Tests.dll' assebmly
System.BadImageFormatException: Failed to load file or assembly 'E: \ TeamCity \ LocalBuildAgent \ BuildAgent \ work \ 698a8f459eac8cd9 \ MyProject \ MyProject.Tests \ bin \ Release \ MyProject.Tests.dll' or one of its dependencies. This assembly is created by the runtime that is newer than the currently loaded runtime and cannot be loaded.

+7
source share
1 answer

My stack is pretty much identical to yours ... so I'm going to take a picture in the dark here.

If you go to the build phase that you specified in Team City to run NUnit and find the .NET Runtime section and make sure that the platform is set to "auto (MSIL)" and, most importantly, make sure the version is installed on v4.0 .

I saw your exact error when trying to run unit tests for project 4.0 with environment 2.0 setup.

If this is not the case, I would suggest checking permissions for directories and that the system or network service accounts that, in my opinion, work in the city of the team (unless otherwise indicated), can access the directory in which your file is located tests.dll.

+8
source

All Articles