This is a migrated thread and some comments may be shown as answers.

Mock cannot detect the profiler. Strange.

1 Answer 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott Ma
Top achievements
Rank 1
Scott Ma asked on 22 Oct 2011, 06:43 AM

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_ENABLE_PROFILING=0x1
set COR_PROFILER={D1087F67-BEE8-4f53-B27A-4E01F64F3DA8}
(I tried without COMPLUS_ProfAPI_ProfilerCompatibilitySetting too.)
set COMPLUS_ProfAPI_ProfilerCompatibilitySetting=EnableV2Profiler

EVENT LOG
.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].

NUnit 2.5.10.11092
JustMock 2011.2.713.2
Window 7 x64. The application is in 32bit mode, .NET 4.0

1 Answer, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 26 Oct 2011, 10:38 AM
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:
http://weblogs.asp.net/mehfuzh/archive/2011/05/24/running-justmock-profiler-outside-of-visual-studio.aspx

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


Kind Regards
Mehfuz
the Telerik team

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

Tags
General Discussions
Asked by
Scott Ma
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Share this question
or