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
We have Typemock 7.3.0.0 Essential with Resharper 7.1.1 and xUnit.

We are able to "Run" tests using the Resharper test runner, no problem.

We cannot "Debug" tests that use Typemock though - it results in an exception:

---
TypeMock.TypeMockException
*** Typemock Isolator is currently disabled. Enable using the following:

* Within Visual Studio:
- Use Typemock Smart Runner
- For other runners, Choose Typemock Menu and click Resume Mocking

* 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

For more information consult the documentation (see 'Running Unit Tests in an Automated Build')
---

Further investigation reveals that the Resharper test running process JetBrains.ReSharper.TaskRunner.CLR4.MSIL.exe has the following environment variable set, while debugging;

COR_PROFILER={b146457e-9aed-4624-b1e5-968d274416ec}

However, using Reflector I can see the following check in Typemock;

private static void a()
{
if ((Environment.GetEnvironmentVariable("COR_PROFILER") != "{B146457E-9AED-4624-B1E5-968D274416EC}") || (Environment.GetEnvironmentVariable("Cor_Enable_Profiling") != "0x1"))
{
if (Environment.GetEnvironmentVariable("COR_PROFILER") != "{D1087F67-BEE8-4f53-B27A-4E01F64F3DA8}")
{
throw new TypeMockException("Typemock Isolator is currently disabled. Enable using the following: * Within Visual Studio: - Use Typemock Smart Runner - For other runners, Choose Typemock Menu and click Resume Mocking * 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 For more information consult the documentation (see 'Running Unit Tests in an Automated Build')");
}
throw new TypeMockException("Typemock Isolator is currently disabled. Enable by turning off JustMock then Choose Typemock Menu and click Resume Mocking");
}
}

It would seem that Typemock does a default comparison (Ordinal, case sensitive) of the GUIDs as strings. Since the one defined in the environment variable is lower case, it fails.

I also notice that the COR_PROFILER for devenv.exe is uppercase {B146457E-9AED-4624-B1E5-968D274416EC}, as expected.

I also notice that the COR_PROFILER for JetBrains.ReSharper.TaskRunner.CLR4.MSIL.exe is uppercase {B146457E-9AED-4624-B1E5-968D274416EC}, while running.

I can't determine why this is lowercase while debugging, but uppercase while running.

Any tips?
asked by Jahmai (2.8k points)

3 Answers

0 votes
Hi Jahmai,

Please make sure that you are not linked with dotCover.
From within VS -> Typemock menu -> options -> Profilers should be set to -none-.

Let me know it it helps.
answered by alex (17k points)
0 votes
Hi Jahmai,

Please make sure that you are not linked with dotCover.
From within VS -> Typemock menu -> options -> Profilers should be set to -none-.

Let me know it it helps.


Unfortunately is already the case.

I have also tried uninstalling, cleaning Typemock registry entries, and re-installing. The problem exists.
answered by Jahmai (2.8k points)
0 votes
Turns out enabling IntelliTrace events and call information was the problem (see image).
The problem does not occur with IntelliTrace events only.

Typemock.Debugging.Problem.PNG (Screenshot of offending setting)
answered by Jahmai (2.8k points)
...