Hi again,
I may have been a bit to quick to accept the patch, cause after additional testing I still get the "invalid program" error from time to time. However, I have now identified a single test where this error can be reproduced.
It appears that I can only reproduce the error when running the tests via an ordered test list using mstest. I'm not using code coverage at the moment (I don't even have a testrunconfig file).
If I disable mocking (via the environment variable Cor_Enable_Profiling=0x0), I'm unable to reproduce the error.
The error message from the .trx file is listed below. Please let me know if you need any additional information.
<message type="System.String">Test method SimCorp.IMS.Threading.Test.HostManagerTest.ExecuteCommand threw exception: System.InvalidProgramException: Common Language Runtime detected an invalid program..</message>
<stackTrace type="System.String">at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(Boolean condition, String message) at SimCorp.IMS.Threading.Test.HostManagerTest.ExecuteCommand() in C:workspacesThreadingTestMainDevelopmentSimCorpIMSThreadingTestHostManagerTest.cs:line 60</stackTrace>
</errorInfo>
- <traceInfo type="Microsoft.VisualStudio.TestTools.Common.TestExecutionTraceInformation">
<trace type="System.Text.StringBuilder">Calling class initialization method SimCorp.IMS.Threading.Test.HostManagerTest.MyClassInitialize. Creating instance of class SimCorp.IMS.Threading.Test.HostManagerTest. Calling initialization method SimCorp.IMS.Threading.Test.HostManagerTest.MyTestInitialize. Calling Test method SimCorp.IMS.Threading.Test.HostManagerTest.Microsoft.VisualStudio.TestTools.TestTypes.Unit.TestMethod.</trace>
</traceInfo>