Question

We're migrating our TeamCity agents from 32bits systems to 64bits and some builds started to fail due to an error in OpenCover.

This is the stacktrace:

E:/BuildAgent/work/7777662cc87ae003/tools/opencover/opencover.console.exe -returntargetcode -target:E:/BuildAgent/work/7777662cc87ae003/tools/nunit/nunit-console.exe -targetargs:"./myTests.dll /framework=v4.0.30319 /noshadow /nologo /work=output /result:my-tests-results.xml" -filter:"+[something]* -[*something.Test]*" -output:results.xml -register:user

[10:43:16][Execute test:coverage] An exception occured: Failed to register(user:True,register:True,is64:False):2 the profiler assembly; you may want to look into permissions or using the -register:user option instead. C:\Windows\system32\regsvr32.exe /s /n /i:user "E:\BuildAgent\work\7777662cc87ae003\tools\opencover\x86\OpenCover.Profiler.dll"

[10:43:16][Execute test:coverage] stack: at OpenCover.Framework.ProfilerRegistration.ExecuteRegsvr32(Boolean userRegistration, Boolean register, Boolean is64)

[10:43:16][Execute test:coverage] at OpenCover.Console.Program.Main(String[] args)

Interesting to notice: 1) we're using the '- register:user' as indicated by the error message 2) although our new agent is a 64bits system, the exception indicates that the register method was called w

Was it helpful?

Solution

Fixed the issue by registering the 64 bits opencover profiler:

regsvr32 /s \{ToolsFolder}\OpenCover\x64\OpenCover.Profiler.dll 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top