Search code examples
azure-devopsopencover

OpenCover on Visual Studio Online


I'm trying to use OpenCover on Visual Studio Online Hosted Build and I end up with the following error:

No results, this could be for a number of reasons. The most common reasons are:
             1) missing PDBs for the assemblies that match the filter please review the
             output file and refer to the Usage guide (Usage.rtf) about filters.
             2) the profiler may not be registered correctly, please refer to the Usage
             guide and the -register switch.

Note that when I am using the -register option, I get the following error:

An exception occured: Failed to register(user:False,register:True,is64:False):5 the profiler assembly;
you may want to look into permissions or using the -register:user option instead.
C:\Windows\system32\regsvr32.exe /s   "d:\a\src\packages\OpenCover.4.5.3723\x86\OpenCover.Profiler.dll"
         stack:    at OpenCover.Framework.ProfilerRegistration.ExecuteRegsvr32(Boolean userRegistration, Boolean register, Boolean is64)
            at OpenCover.Console.Program.Main(String[] args)

I am nearly sure I cannot use regsvr32 on VSO due to insufficient rights. So my question is: Is there an alternate way?

Thank you


Solution

  • If administrative privileges are required on the computer for an installation, there's no way for you to do it in hosted build. You will have to create your own build machine in this case. It's something we hope to solve in the future.

    I haven't looked at regsrv32 in a long time, but you could try the -register:user option suggested in the message.