I had the same problem with a MSTest project that did not use TypeMock or even reference TypeMock. I took this problem to the component vendor's tech support, as the stack trace pointed way down into the bowels of their component. The only reason I thought to consider TypeMock is TypeMock is the only thing I've installed between now and when the tests worked.
Unfortunately, I had to uninstall TypeMock, as I have to be able to get things done. Too bad, as I was very excited to use it.
For what it is worth, here is the stack trace:
--
TestCase 'TestProject1.UnitTest1.TestMethod1'
failed: System.InvalidProgramException: Common Language Runtime detected an invalid program.
at Atalasoft.Imaging.Lib.IS.FirstLevelIOCBWrapper.AddRealCallbacks(IOCallbacks_NonMarshallingWrapper wrapper, Boolean bAppend)
at Atalasoft.Imaging.Lib.IS.FirstLevelIOCBWrapper.OpenUserSource(UserOpenCallback pOpenFn, UserReadCallback pReadFn, UserSeekCallback pSeekFn, UserGetPosCallback pPosFn, UserGetSizeCallback pSizeFn, UserEOFCallback pEOFFn, UserCloseCallback pCloseFn, Int32 uUserInfo)
at Atalasoft.Imaging.Lib.IS._IS40_OpenUserSource(UserOpenCallback pOpenFn, UserReadCallback pReadFn, UserSeekCallback pSeekFn, UserGetPosCallback pPosFn, UserGetSizeCallback pSizeFn, UserEOFCallback pEOFFn, UserCloseCallback pCloseFn, Int32 uUserInfo)
at atalabh.a(UserOpenCallback A_0, UserReadCallback A_1, UserSeekCallback A_2, UserGetPosCallback A_3, UserGetSizeCallback A_4, UserEOFCallback A_5, UserCloseCallback A_6, Int32 A_7)
at atalabh..ctor(Stream A_0, atalah3 A_1)
at Atalasoft.Imaging.Codec.TgaDecoder.GetImageInfo(Stream stream)
at Atalasoft.Imaging.Codec.TgaDecoder.IsValidFormat(Stream stream)
at Atalasoft.Imaging.Codec.RegisteredDecoders.GetDecoder(Stream stream)
at Atalasoft.Imaging.Codec.RegisteredDecoders.GetImageInfo(Stream stream)
at Atalasoft.Imaging.Codec.RegisteredDecoders.GetImageInfo(String fileName)
C:DavidVisual Studio ProjectsCeoimage.Documents SolutionTestExtractedTestProject1ImageInfo.cs(23,0): at TestProject1.ImageInfo.UpdateImageInfo(String path)
C:DavidVisual Studio ProjectsCeoimage.Documents SolutionTestExtractedTestProject1UnitTest1.cs(46,0): at TestProject1.UnitTest1.TestMethod1()
--