System.InvalidProgramException : Common Language Runtime detected an invalid program. (justMock + xUnit + dotCover)

1 Answer 1106 Views
Async Mocking Code Coverage General Discussions Integrations Static Mocking
Milind
Top achievements
Rank 1
Milind asked on 20 Jul 2021, 11:47 AM

Hi Team

We tried executing justMock test cases in command prompt using justMock Console (licensed), dotCover and xUnit, but justMock Test execution failed and gave the error "System.InvalidProgramException : Common Language Runtime detected an invalid program." 

The command we use to execute is as follows:

start /wait "" "{PATH}\JustMock\Libraries\Telerik.JustMock.Configuration.exe" /link "dotCover"

"{PATH}\JustMock\Libraries\Telerik.JustMock.Console.exe" runadvanced --profiler-path-64 "{PATH}\JustMock\Libraries\CodeWeaver\64\Telerik.CodeWeaver.Profiler.dll" --command "{PATH}\JetBrains.dotCover.CommandLineTools.2021.1.3\dotCover.exe" --command-args "cover --reporttype=html --output=CodeCoverage\\index.html --targetexecutable=\"{PATH}\xunit.runner.console.2.4.1\tools\net472\xunit.console.exe\" -- \"{PATH}\{PATH_OF_JUSTMOCK_TEST_DLL}\""

start /wait "" "{PATH}\JustMock\Libraries\Telerik.JustMock.Configuration.exe" /unlink "dotCover"

 

Attaching the log and test code.

Mihail
Telerik team
commented on 23 Sep 2021, 03:01 PM

Hi,

We've confirmed that there is an issue with an InvalidProgramException being thrown when code coverage is used to execute the unit tests with Visual Studio. The issue is related to unit testing a specific cache mechanism 

However, the reporting issue here may not be the same. This is why I will strongly recommend a minimal working sample project to be provided which we can use to reproduce the described behavior. This way we will know more about the underlying issue and more quickly resolve it.

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 21 Jul 2021, 12:10 PM

Hello Milind,

The error is related to async test ScriptDetail_Test, how exactly it would be hard to say without more details. Please try to extract the minimal working sample which reproduces the issue and attach it to the thread.

Regards,
Ivo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Async Mocking Code Coverage General Discussions Integrations Static Mocking
Asked by
Milind
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or