Search code examples
unit-testingvisual-studio-2013code-coveragencover

NCover not finding unit tests


I am trying to install NCover in an existing C# .NET project for work. Unfortunately, after I download NCover and installed the Visual Studio extension, it wasn't finding any of the unit tests. The answers I've seen/heard seem to be in the vain of 'It wasn't working...time passed...it started working.'

I can run the tests with Visual Studio's Test Explorer, but I need to get NCover installed to see the code coverage. I had NCover installed previously, and other people on my team are getting it to work within the same project.

I am using Visual Studio 2013 with the newest version of NCover Desktop (v 5.1).

I am getting two errors in the console log.
The first switches between saying:

Agent Error (v4x64): An error occurred while loading assembly

and

Agent Error (v4x64): There was a problem loading test assembly [test path]. Could not get bytes from loader AppDomain

The second (after I try to run NCover) says it 'Could not load config' for the test dll.

I copied the 4 XML config file (Bolt.ext.config, Bolt.Extension2008.dll.config, NCover.exe.config, ncover.axplorer.exe.config) from one of my team members, so I'm pretty sure that I have my config correct.

Has anyone else experience this/have any suggestions? Help would be greatly appreciated!


Further information:

When I hover over the grayed out test dll in the bolt test panel, I get the following error:

Assembly is not loaded. Select and run to build and load this assembly

I was looking at this post, but it doesn't seem like any of the solutions are working for me...


Solution

  • After working with some of the other developers in my office, we discovered the issue was with the NCover version. For our tests to run, we needed to use NCover v5.0. Neither v5.1 or v5.2 would work with our setup. Not sure what changed in v5.1 that wouldn't let it find the tests, but I'm glad it's working now :)