DotCover console runner fails when running as VSTS task

Completed

I am getting the following error when running the dotcover console tool from by CI build in Microsoft Visual Studio Team Services.

Failed to verify x64 COM object registration: Empty path to COM object.

The command I am running is:

dotcover analyse /TargetExecutable="c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\MSTest.exe" /TargetArguments="/testcontainer:$(build.sourcesdirectory)\PATH_TO_MY_TEST\TEST.DLL" /Output=$(build.sourcesdirectory)\PATH_TO_MY_TEST\coverage.xml

When I run the exact same command from my server it all works just fine and the coverage file is created. Seeing the other posts I suspect it has something to do with the permissions the VSTS agent Windows account has, but I cannot figure out what.

Do you have any suggestions? This would be a very cool way to get code coverage in my CI builds!

Kind regards,

Martijn

Possibly (probably) related to: https://dotnettools-support.jetbrains.com/hc/en-us/community/posts/207330745-Failed-to-verify-x64-COM-object-registration-using-DotCover-Command-Line-10-0-2-from-TFS-2015-Build

3 comments
Comment actions Permalink

Hi Martijn,

You could try to use a registry-free dotCover configuration in the case of a limited account. 
dotCover, in this case, should be started with additional command line parameter: /CoreInstructionSet=[x86|x64] , where x86 or x64 refers to the profiled process bitness.

0
Comment actions Permalink

Sorry for the late reply. I just tried you suggestion using the /CoreIntructionSet parameter. If I use that I do indeed no longer get the COM exception and the tests are being run and analysis is started. But that's it, the dotcover app appears to be hanging on something, the process remains active with zero activity.

I get the same effect when I execute the command locally. If I remove the CoreInstructionSet parameter locally then it does generate the coverage report. What am I still missing to get it to work on my server? Would it help if I granted the TFS account access to some registry keys?

Kind regards,

Martijn Kooij

Here's the command I am running:

dotcover analyse /TargetExecutable="c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\MSTest.exe" /TargetArguments="/testcontainer:c:\pathtoproject\bin\debug\project.Test.dll /resultsfile:c:\pathtoproject\bin\debug\TestResults.trx" /Output=c:\pathtoproject\bin\debug\coverage.xml /CoreInstructionSet=x64 /LogFile=c:\Temp\dotcover.txt /ReturnTargetExitCode

 

And the logfile:

13:53:43.837 |I|                               | JetBrains dotCover Console Runner 2017.3.3. Build 111.0.20180302.72821
13:53:43.848 |I|                               | LogLevel: INFO
13:53:44.046 |I|                               | 'analyze' command
13:53:44.046 |I|                               | /TargetExecutable=c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\MSTest.exe (CommandLine)
13:53:44.046 |I|                               | /TargetArguments=/testcontainer:c:\pathtoproject\bin\debug\project.Test.dll /resultsfile:c:\pathtoproject\bin\debug\TestResults.trx (CommandLine)
13:53:44.046 |I|                               | /Output=c:\pathtoproject\bin\debug\coverage.xml (CommandLine)
13:53:44.046 |I|                               | /CoreInstructionSet=x64 (CommandLine)
13:53:44.046 |I|                               | /LogFile=c:\Temp\dotcover.txt (CommandLine)
13:53:44.046 |I|                               | /ReturnTargetExitCode= (CommandLine)
13:53:44.047 |I|                               | Current directory: c:\pathtoproject
13:53:44.047 |I|                               | Validating command...
13:53:44.048 |I|                               | Intermediate file for the 'analyze' command: C:\Users\Martijn\AppData\Local\Temp\tmpCC0A.tmp
13:53:44.050 |I|                               | Executing command...
13:53:44.200 |I|                               | Coverage session started [28/03/2018 13:53:44]

0
Comment actions Permalink

Back at it again.

I misread/misinterpreted Fedor's comment about bitness and used x64 as that was my OS bitness... But I was running coverage on an x86 project so I should have chosen that. After changing that the coverage works just fine using VSTS!

Thanks for the help.

0

Please sign in to leave a comment.