Question

I'm trying to run OpenCover with MSTest on Windows Server 2008 R2 machine and always get empty results:

c:\OpenCover>OpenCover.Console.exe -register:user -target:"C:\Program Files (x86 )\Microsoft Visual Studio 11.0\Common7\IDE\MsTest.exe" -targetdir:"c:\MyApp\bin" -targetargs: /testcontainer:"C:\MyApp\Tests\bin\UnitTests.dll" -output:c:\cover.xml

Microsoft (R) Test Execution Command Line Tool Version 11.0.51106.1

Copyright (c) Microsoft Corporation. All rights reserved.

Please specify tests to run, or specify the /publish switch to publish results.

For switch syntax, type "MSTest /help"

Committing...

No results - no assemblies that matched the supplied filter were instrumented this could be due to missing PDBs for the assemblies that match the filter please review the output file and refer to the Usage guide (Usage.rtf)

The PDB files exist in the specified folder and the profiler DLLs are registered using regsvr (both x64 and x86). Microsoft Visual C++ 2010 Redistributable Package is installed. .NET framework 3.5, 4.5 installed. I've tried to run it with and without administrator permissions...

At the same time it works perfectly on my win7 x64 machine with VS 2012 installed so I suppose I've missed some dependancies or this is a security issue.

After removing quotes and spaces I receive a better result but still without code coverage:

enter image description here

Was it helpful?

Solution

Which version of OpenCover?

The latest version should not require "Microsoft Visual C++ 2010 Redistributable Package"

If you have registered the assemblies using resvr32 then you do not need the -register:user switch.

As it does not look like you tests are running it looks like the parameters you are passing through are incorrect (a space between "-targetargs: /target...", try:

"-targetargs:/testcontainer:C:\MyApp\Tests\bin\UnitTests.dll"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top