Over the weekend Visual Studio was upgraded to 16.10.0 on our self-hosted Azure DevOps agent server. This has caused all of our unit tests that rely on the JustMock profiler to begin failing with the Exception:
Failed {METHODNAME} [6 ms]
Error Message:
Test method {NAMESPACE}.{CLASSNAME}.{METHODNAME} threw exception:
System.InvalidProgramException: Common Language Runtime detected an invalid program.
Stack Trace:
at {NAMESPACE}.{CLASSNAME}.{METHODNAME}()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at {NAMESPACE}.{CLASSNAME}.{METHODNAME}()
We are using JustMock R2 2021, the Telerik JustMock VSTest v.2 (v2.6.1) pipeline task, and our test projects are targeting netcore3.1.
The tests run and pass when executed locally through Visual Studio (16.10.0) Test Explorer, but fail during pipeline execution. Nothing else has changed on the agent server except for the Visual Studio upgrade that I am aware of.
Pipeline YAML: