InvalidProgramException after upgrading dotCover from 2.0.425.72 to 2016.1

Answered

After upgrading our TeamCity server out test coverage builds are failing with an exception:

System.InvalidProgramException: Common Language Runtime detected an invalid program.

All other unit test configurations run fine on the same code. Looking at the logs the only difference we see is the dotCover version. Old and new both using Nunit 2.6.2 under .NET 4.0 x86. Coverage builds still work fine on old server using the same code. The agents were just pointed to the new server, no OS or tools changed.

Any thoughts?

 

7 comments
Comment actions Permalink

Hello Robert,

Could you please turn on dotCover logging and send us log files? For that, please set configuration parameter teamcity.agent.dotCover.log with path to logs folder for dotCover. All log files will be placed there and TeamCity will publish zipped logs to .teamcity/.NETCoverage/dotCoverLogs.zip artifacts path.

Thanks in advance. Best regards.

0
Comment actions Permalink

I am facing the same issue when using ncover. The issue is pertinant to test that have the TestCase attribute, it works fine where the unit test dont have TestCase attribute.  I am running dot cover locally. If run the same test using nunit3-console.exe it works fine. 

Below is th config

<AnalyseParams>
<TargetExecutable>C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe</TargetExecutable>
<TargetArguments>c:test\Api.Test.dll --trace=Verbose</TargetArguments>
<TargetWorkingDir>C:\test</TargetWorkingDir>
<Output>AppCoverageReport.html</Output>
<ReportType>HTML</ReportType>
<Filters>
<ExcludeFilters>
<FilterEntry>
<ModuleMask>Moq.*</ModuleMask>
</FilterEntry>
<FilterEntry>
<ModuleMask>NUnit.*</ModuleMask>
</FilterEntry>
</ExcludeFilters>
</Filters>
</AnalyseParams>

System.InvalidProgramException : Common Language Runtime detected an invalid program.
at NUnit.Framework.Internal.TestParameters..ctor(ITestData data)
at NUnit.Framework.Internal.TestCaseParameters..ctor(ITestCaseData data) in C:\src\nunit\nunit\src\NUnitFramework\framework\Internal\TestCaseParameters.cs:line 68
at NUnit.Framework.TestCaseAttribute.GetParametersForTestCase(IMethodInfo method) in C:\src\nunit\nunit\src\NUnitFramework\framework\Attributes\TestCaseAttribute.cs:line 268

Any thoughts ?

 

0
Comment actions Permalink

The same issue here. TeamCity 2018.1 (build 58245), JetBrains.dotCover.CommandLineTools.2018.1.3.

Where exactly to set teamcity.agent.dotCover.log ? File, path?

0
Comment actions Permalink

if you are running dotcommand via command line then there is a parameter that you can specify to generate the log.. Example below

 

dotCover.exe analyse coverage.xml /LogLevel=Verbose /LogFile=C:\log\resharper_log.txt

0
Comment actions Permalink

We used 

```

#tool nuget:?package=JetBrains.dotCover.CommandLineTools&version=2018.1.2

```

 

together with NUnit.3.10.1. 

 

2018.1.2 is the broken version of dotCover that generates errors like

 

 

======= Failed test run #1 ==========
System.InvalidProgramException : Common Language Runtime detected an invalid program.
at NUnit.Framework.Internal.TestParameters..ctor(ITestData data)
at NUnit.Framework.Internal.TestCaseParameters..ctor(ITestCaseData data) in C:\src\nunit\nunit\src\NUnitFramework\framework\Internal\TestCaseParameters.cs:line 68
at NUnit.Framework.TestCaseAttribute.GetParametersForTestCase(IMethodInfo method) in C:\src\nunit\nunit\src\NUnitFramework\framework\Attributes\TestCaseAttribute.cs:line 268 ======= Failed test run #2 ========== System.InvalidProgramException : Common Language Runtime detected an invalid program.
at NUnit.Framework.Internal.TestParameters..ctor(ITestData data)
at NUnit.Framework.Internal.TestCaseParameters..ctor(ITestCaseData data) in C:\src\nunit\nunit\src\NUnitFramework\framework\Internal\TestCaseParameters.cs:line 68
at NUnit.Framework.TestCaseAttribute.GetParametersForTestCase(IMethodInfo method) in C:\src\nunit\nunit\src\NUnitFramework\framework\Attributes\TestCaseAttribute.cs:line 268

 

Fixed by downgrading to 

```

#tool nuget:?package=JetBrains.dotCover.CommandLineTools&version=2017.3.2

```

 

 

1
Comment actions Permalink

Thank you Dimitry... After downgrading it worked fine..

0
Comment actions Permalink

Hi folks! 

Unfortunately, it is a known issue https://youtrack.jetbrains.com/issue/DCVR-9232, but it is already fixed in the ReShaper 2018.2 EAP builds.
Could you please try dotCover console runner from these builds?

0

Please sign in to leave a comment.