When using a LocalReport object within a unit test where TypeMock Isolator was running, I got the error:
Microsoft.Reporting.WinForms.LocalProcessingException : An error occurred during local report processing. ----> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException : Failed to load expression host assembly. Details: Operation could destabilize the runtime.
If TypeMock Isolator was disabled, the test ran correctly. This particular test was not using TypeMock calls at all. It was just the presence of the TypeMock Isolator engine that caused the error. I assumed that there was some conflict between TypeMock Isolator and the report processing engine.
This post, by Mohamed Sharaf, provided some clues as to what was causing the error. In the end, using the ExecuteReportInCurrentAppDomain method allowed the test to run correctly.
Advertisement