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

Profiler must be enabled - VS11 Update 2

3 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 17 Apr 2013, 10:31 AM
Hi!

Since I've updated my Visual Studio Premium 2012 to Update 2 (Version: 11.0.60315.01 Update2) following error message is shown when executing Unit-Tests:

Test method XY threw exception: Telerik.JustMock.MockException: Profiler must be enabled to mock/assert target XY method.

With Update 1 everything works fine. Thus, if I uninstall Update 2 the tests are running again. I've tried JustMock 2012.1.608.2 and JustMock Q1 2013 SP1.

Microsoft .NET Framework Version 4.5.50709

Unit-Test code
Line 10: Mock.SetupStatic(typeof(XY));
Line 11: Mock.Arrange(() => XY.XY()).Returns("xy");

Exception when Unit-Test code is executed
at Telerik.JustMock.Handlers.InterceptorHandler.Create(Object target, MethodInfo methodInfo, Boolean privateMethod)
  at Telerik.JustMock.MockContext`1.SetupMock(MockExpression`1 expression)
  at Telerik.JustMock.MockContext`1.SetupMock(Expression`1 expression)
  at Telerik.JustMock.Mock.<>c__DisplayClass1`1.<Arrange>b__0(MockContext`1 x)
  at Telerik.JustMock.MockContext.Setup(Instruction instruction, Func`2 function)
  at Telerik.JustMock.Mock.Arrange(Expression`1 expression)
  at XY() in XY.cs: line 11


This is a very important issue for me, because I want to migrate from Moles to JustMock.

Can anyone help? 

Thank you!

3 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 19 Apr 2013, 02:19 PM
Hi Christian,

It is unfortunate that you are experiencing issue with JustMock.

To assist you, I will suggest checking this article and completing the steps in it.

Also, make sure all the Visual Studio profilers are disabled when executing your tests (IntelliTrace, CodeCoverage).

If the issue still remains after completing the above, we will require the logs from event with ID 1022 (this is better described in step 4) from the link).

I hope this helps. Please, inform us if you need further assistance.

Kind regards,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Julia Lerman
Top achievements
Rank 1
answered on 26 Apr 2013, 06:44 PM
I tried everything in the KB article  on this topic (http://www.telerik.com/support/kb/justmock/general/handling-the-profiler-must-be-enabled-exception-in-justmock.aspx) and was still getting failures when debugging my test(s), but not running them.

The suggestion in this thread about Intellitrace was one profiler I hadn't thought of and disabling that did the trick.

Perhaps you could add that very helpful suggestion to the KB article? :)

Thanks
0
Kaloyan
Telerik team
answered on 29 Apr 2013, 07:02 AM
Hello Julia,

I am glad you have solved the issue.

Also, thanks for the feedback. The article will be updated accordingly.

Please, contact us again if you need help with anything concerning JustMock.

Greetings,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Tags
General Discussions
Asked by
Christian
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Julia Lerman
Top achievements
Rank 1
Share this question
or