Run coverage from visual studio and from command line get different result, how to correct it?

284 views Asked by At

I have a project with unit test, when I right click project and run from visual studio, I got 100% coverage. Please see attachment coveargeA.jpg

The method is CleanUpInProcessExperiments.
enter image description here

but when I run it with command line, then I got 0% coverage, see attachment coverageB.jpg. How can I match command line with directly run from visual studio. in fact, I have few methods other than this one has similar issue Really appreciate for any help.

enter image description here

Here is the command line I used:

C:\Users\yanghx14\AppData\Local\JetBrains\Installations\dotCover04\dotCover.exe cover /TargetExecutable="C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe" /TargetWorkingDir=C:\xxx\ExpMgmt.Tests\bin\Release /TargetArguments="C:\xxx\ExpMgmt.Tests\bin\Release\ExpMgmt.Tests.dll /framework=4.0 /xml=C:\xxx\ExpMgmt.Tests\bin\Release\ExpMgmt.Tests.dll-results.xml /timeout=20000 /noshadow=true" /Output=c:\xxx\3.dcvr

0

There are 0 answers