Mock cannot detect the profiler. Strange.

2 posts, 0 answers
  1. Scott Ma
    Scott Ma avatar
    1 posts
    Member since:
    Apr 2010

    Posted 22 Oct 2011 Link to this post

    I'm running Nunit with this profiler settings in 32bit. In the event log, it clearly shows that the profiler is running.But when I run "Mock.IsProfilerEnabled", it returns false. When I tried to create a sealed class, it said "Telerik.JustMock.MockException : Could not create mock from sealed class when profiler is not enabled.". The strange thing is, it was working at one point yesterday. Today, reboot the machine a couple of times, now it doesn't work.

    Environment Variables
    set COR_PROFILER={D1087F67-BEE8-4f53-B27A-4E01F64F3DA8}
    (I tried without COMPLUS_ProfAPI_ProfilerCompatibilitySetting too.)
    set COMPLUS_ProfAPI_ProfilerCompatibilitySetting=EnableV2Profiler

    .NET Runtime version 4.0.30319.239 - The profiler was loaded successfully.  Profiler CLSID: '{D1087F67-BEE8-4f53-B27A-4E01F64F3DA8}'.  Process ID (decimal): 6968.  Message ID: [0x2507].

    JustMock 2011.2.713.2
    Window 7 x64. The application is in 32bit mode, .NET 4.0
  2. Ricky
    Ricky avatar
    467 posts

    Posted 26 Oct 2011 Link to this post

    Hi Scott,

    Thanks again for reporting the issue. Here I would like to ask which test runner you are using. If you are using TestDriven.Net then you need to use the RTM version. Secondly, you also need to check whether you have other tools that use profiler ( eg.TypeMock) are installed and interfering with JustMock profiler.

    Moreover, if you are running tests using NUnit standalone runner then you can try using the JustMockRunner that lets you run JustMock elevated tests in a standalone tool.

    You can find more information on JustMockRunner in the following post:

    Finally, please check that “Enable JustMock” is grayed out in JM profiler add-in inside visual studio.

    Kind Regards
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft R3 2016 release webinar banner
Back to Top