chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
I am having a problem running Typemock Isolated tests from VS.Net 2012. I can run the tests fine with testdriven.net but I cannot run them through Microsoft's test runner. I got back an error indicating that Typemock needs to be enabled.

TypeMock.TypeMockException:
*** Typemock Isolator is not currently enabled.
To enable do one of the following:

* To run Typemock Isolator as part of an automated process you can:
- run tests via TMockRunner.exe command line tool
- use 'TypeMockStart' tasks for MSBuild or NAnt

* To work with Typemock Isolator inside Visual Studio.NET:
set Tools->Enable Typemock Isolator from within Visual Studio

For more information consult the documentation (see 'Running' topic)
Result StackTrace:
at gn.a()
at gn.d()
at TypeMock.MockManager.Init(Boolean collectAllCalls)
at TypeMock.MockManager.Init()
at TypeMock.RecorderManager.a(RecordExpectations A_0)
at TypeMock.RecordExpectations..ctor()
at TypeMock.RecorderManager.StartRecording()
at GameFly.UnitTest.Commons.Logging.HttpExcludeFixture.AcceptsAllowedReferrer()


I do not see any option to enable typemock from the tools menu. I believe Typemock should be running because I have the option to "suspend mocking" from the typemock menu.

I also get errors from Typemocks test runner.
Failure:
System.InvalidProgramException : Common Language Runtime detected an invalid program.

I have the latest version of Typemock.

Please let me know what further information I can provide to help resolve this issue.

Thanks,
Jesse
asked by jnapier (9.6k points)

14 Answers

0 votes
I have a little bit more information for you on this.

I have figured out this this only occurs if I have code coverage enabled through the .runsettings file. If I disable code coverage through that file then I can run the tests through visual studio without a problem.

With Code Coverage enabled, I have tried linking Typemock to the Visual Studio 2012 profilers and I get different types of errors such as this

------ Run test started ------
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
========== Run test finished: 0 run (0:02:19.0139) ==========

and I get a pop up window from vstest.discoveryengine.exe indicating that it has stopped working.


If I try to run the test through the TypeMock runner with profiler linking then then test runner hangs.

Please let me know if there is any additional information I can provide.
answered by jnapier (9.6k points)
0 votes
Hello Jesse,

The code coverage issue in VS 2012 is a known bug and we are working on a possible fix these days.

I'll keep you posted as soon as we'll have a patch available.


Thanks you for your post.
answered by NofarC (4k points)
0 votes
Hello Jesse,

Please try installing this patch.

Notice that you don't need to link Typemock Isolator to VS 2012 anymore,
and you can run the tests only from VS.
Looking forward for your feedback!
answered by NofarC (4k points)
0 votes
I have installed the latest typemock release and still cannot run test from VS.Net. I get this error

------ Run test started ------
Exception has been thrown by the target of an invocation.
========== Run test finished: 0 run (0:00:04.7644764) ==========

It does not matter if code coverage is enabled or not, the test still fail with the above error. It seems like a step was taken backwards.

Please help resolve this problem by letting me know if there is anymore information I can provide.
answered by jnapier (9.6k points)
0 votes
Hello,

If the machine is installed with the latest windows update than this is probably the reason.
There are some breaking changes to the .net framework that cause the Isolator to fail. We are working to fix it and we'll release the update ASAP.

If you didn't recently updated your machine, can you please provide a project that reproduces this issue?
answered by NofarC (4k points)
0 votes
Is this fixed with TypeMock 7.2.5?
answered by aklefdal (180 points)
0 votes
Hi,

All issues caused by the MS update should be solved in V7.2.5.
answered by alex (17k points)
0 votes
I see that as of today 2/21, v7.2.5 is the version publicly available.

Is there another release pending that is supposed to fix the problems with the Microsoft Security patches? There was an email sent from TypeMock noting that this fix will be available on Feb 24.

I don't want to have to upgrade twice. Please clarify :D
answered by dblack (8.4k points)
0 votes
Hi,

Isolator 7.3.0 will be released on Feb-24, it'll contain fixes to the patch and some additional improvements.
answered by Elisha (12k points)
0 votes
Hi Elisha,

Will 7.3.0 also fix the original problem that started this thread?

We are also getting the "exception has been thrown by target of an invocation" error when running unit tests configured with code coverage with msbuild 2012 when using a runsettings file.
I just want to make the distinction that this is a different error than the changes made by the Microsoft hotfixes and ensure that fixes for both of these problems are coming in v7.3.0.

Thank you for your time.
answered by dblack (8.4k points)
...