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.
Similar issue here:
https://www.telerik.com/forums/azure-pipeline-justmockvstest-2-elevated-not-working-system-invalidprogramexception-common-language-runtime-detected-an-invalid-program
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.