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

Error: The profiler must be enabled (but it is !)

2 Answers 860 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Francis asked on 07 Jul 2020, 02:44 PM

Visual Studio Professional 2019 - version 16.6.3

JustMock 2019.1.115.2 (Commercial version)

My solution has 3000+ unit tests and suddenly, 1000+ tests failed with the error :

 Message: 
    Test method Cloee2.Ws.UnitTests.Services.Business.TestConditionsAdmissionSe2.GetClasseGeneriqueNulle threw exception: 
    Telerik.JustMock.Core.ElevatedMockingException: Cannot mock 'Ch.Ne.Ceg.Cloee2.Services.CrudCloee2Helper'. The profiler must be enabled to mock, arrange or execute the specified target.
  Stack Trace: 
    ProfilerInterceptor.ThrowElevatedMockingException(MemberInfo member)
    MocksRepository.InterceptStatics(Type type, MockCreationSettings settings, Boolean mockStaticConstructor)
    MocksRepository.ConvertExpressionToCallPattern(Expression expr, CallPattern callPattern)
    MocksRepository.Arrange[TMethodMock](Expression expr, Func`1 methodMockFactory)
    ProfilerInterceptor.GuardInternal[T](Func`1 guardedAction)
    TestConditionsAdmissionSe2._arrangeSearchFormations() line 523
    TestConditionsAdmissionSe2._mockGetClasseGenerique() line 913
    TestConditionsAdmissionSe2.GetClasseGeneriqueNulle() line 987

They pass in debug, but not in run.

I try to clear bin and obj folder of my solution, but nothing to do.

Any idea ?

2 Answers, 1 is accepted

Sort by
0
SIEN
Top achievements
Rank 1
Iron
Iron
answered on 08 Jul 2020, 05:49 AM
I upgrade JustMock to version 2020.1.616.2 and the problem is gone.
0
Ivo
Telerik team
answered on 08 Jul 2020, 08:49 AM

Hello All,

I confirm that the issue is related to the particular version, please take a look at these release notes. Upgrade to R3.2019 (2019.3.910.4) and above should fix this issue.

I hope the provided information helps. If you have further questions do not hesitate to contact us again.

Regards,
Ivo
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Quad
Top achievements
Rank 1
commented on 14 Nov 2023, 06:09 PM

I'm having this same issue now, but am on 2023.2.719.137 using VS 2022. Profiler is enabled in IDE, IsProfilerEnabled is true when debugging tests, but false when running tests normally. Is there a similar problem with this release?
Ivo
Telerik team
commented on 16 Nov 2023, 11:00 AM

No there is no such known issue, please try to get the output of the following helper:

private static string GetEnvironmentEntries()
{
    var varEntries =
        Environment.GetEnvironmentVariables()
            .OfType<DictionaryEntry>()
            .Where(entry => entry.Key.ToString().StartsWith("COR_") || entry.Key.ToString().StartsWith("CORECLR_") || entry.Key.ToString().StartsWith("JUSTMOCK_"))
            .Select(entry => string.Format("{0} = {1}", entry.Key, entry.Value))
            .ToList();
    return string.Join(Environment.NewLine, varEntries.OrderBy(e => e));
}

Tags
General Discussions
Asked by
Francis
Top achievements
Rank 1
Answers by
SIEN
Top achievements
Rank 1
Iron
Iron
Ivo
Telerik team
Share this question
or