I just installed TM 5.3.4, but I was having the same issue in 4.3.2. Some tests create a Form that has a tool strip.
I can run a test that creates this Form without mocking anything, and the test runs fine; if mocking has already started, the test fails.
The creation of the Form fails with this exception:
Test method Tests.CreateReviewControllerTest.OpenReviewTestOK threw exception: System.InvalidCastException: Unable to cast object of type 'System.Windows.Forms.LabelImageIndexer' to type 'System.Windows.Forms.ImageList'..
At least the former type is an internal type. The exception is happening when the ToolStripDropDownMenu is creating its Up and Down scroll buttons; it's totally internal.
I noticed this in the debug output:
A first chance exception of type 'System.InvalidCastException' occurred in System.Windows.Forms.dll
A first chance exception of type 'System.InvalidCastException' occurred in TypeMock.dll
So I think something in TypeMock is causing the framework to blow up.
I have run with and without code coverage, I get the same results.
EDIT: This is VS2005, .NET 2.0 SP 2.