The profiler must be enabled to mock and Detected active third-party profilers Issue

1 Answer 457 Views
General Discussions
Francis
Top achievements
Rank 1
Francis asked on 06 May 2021, 08:36 AM

I am new to JustMock, I try to use it in .NET5 but failed, I have seen some articles related to this kind of problem but I failed to resolve it. At the same time, I use MOQ for this project, I have tried TypeMock before but have already uninstalled.

Message: 
    Test method  threw exception: 
    Telerik.JustMock.Core.ElevatedMockingException: Cannot mock 'BitCoinLib.Database.Connection'. The profiler must be enabled to mock, arrange or execute the specified target.
    Detected active third-party profilers:
    * {324F817A-7420-4E6D-B3C1-143FBED6D855} (from process environment)
    Disable the profilers or link them from the JustMock configuration utility. Restart the test runner and, if necessary, Visual Studio after linking.
  Stack Trace: 
    ProfilerInterceptor.ThrowElevatedMockingException(MemberInfo member)
    MocksRepository.InterceptStatics(Type type, MockCreationSettings settings, Boolean mockStaticConstructor)
    <>c__DisplayClass67_0.<SetupStatic>b__0()
    ProfilerInterceptor.GuardInternal(Action guardedAction)
    Mock.SetupStatic(Type staticType, StaticConstructor staticConstructor)

 

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 10 May 2021, 08:42 AM

Hello Francis,

I see that you are using an advanced (elevated) mode unit testing, so in this case, the framework requires the JustMock profiler to be loaded in order to succeed. The exception message states that some other profiler is loaded at the same time, which is not allowed by the runtime.

What can be done?

Some googling around the GUID from the error description points me to a tool for monitoring web applications. Since JustMock does not have integration (more details can be found in this article) with this tool, you have to find a way to disable it, I suppose that it could be achieved via some settings or extension menu options inside Visual Studio.

I hope this information helps. If you are still facing any troubles I will be glad to assist you further.

Regards,
Ivo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Minh
Top achievements
Rank 1
Iron
commented on 19 Apr 2023, 10:53 PM

I also have the same error with the same profilers Guid 324F817A-7420-4E6D-B3C1-143FBED6D855, using vS2022 Enterprise "Analyze Code Coverage for All Test".

How can I disable or link this profiler with justmock?    

Ivo
Telerik team
commented on 20 Apr 2023, 07:34 AM

Basically, you have to open the JustMock integration tool using the Visual Studio menu Extensions > JustMock > Intergtaions..., then find and verify that Visual Studio 2017/2019 Code Coverage/IntelliTrace entry is checked.
Tags
General Discussions
Asked by
Francis
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or