I've recently upgraded to VS2019 and JustMock 2019.508.1 (we have a DevCraft license), and tests requiring elevated mode are no longer functioning. We receive the following error when only linking the VS 2019 Profiler with JustMock:
Telerik.JustMock.Core.ElevatedMockingException: Telerik.JustMock.Core.ElevatedMockingException: Cannot mock 'EL.BusinessLayer.LegacyTaskCloseRequestEntity PostRentScheduleEntitiesToLegacy(EL.BusinessLayer.LegacyTaskCloseRequestEntity, System.String, System.String, System.String, System.String, System.Collections.Generic.ICollection`1[System.String])'. The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
* {9317ae81-bcd8-47b7-aaa1-a28062e41c71} (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..
That guid refers to the VS Code Coverage profiler, which does appear in the Telerik JustMock Configuration profiler list. However, when I select that profiler then the tests will no longer even start - the progress bar will display its green runner going from left to right, but none of the tests will ever start spinning and after a minute or two the progress bar just stops without displaying any errors or messages.
We had also started .NET Core development in VS2017, and had found that we needed to add dotnet.exe to the Codeweaver ImageBlacklist.cfg file. The behavior we are seeing with tests not ever starting to run reminds me of that behavior with dotnet.exe, and I'm wondering if there is a new VS2019 executable for testing that needs to be added to that blacklist file?
9 Answers, 1 is accepted
Thank you for contacting us about this issue.
We are aware that there is a problem with the integration with VS Code Coverage and we already have an bug report logged into our feedback portal. Here is a link if you would like to follow it and receive status updates: Code coverage not working with Visual Studio 2019. The title says VS 2019, but the problem is affecting other versions of VS as well.
I am afraid that there is no workaround for this particular problem. You could expect a fix later this month.
If you have further questions or comments feel free to write back to us.
Regards,
Mihail
Progress Telerik

We are using JustMock with Visual Studio 2017 & .Net Framework 4.6.1 for mocking the non public method without any issues. However the same test case is failing when we migrate it into .Net Core 2.2. Please advise!
The exception stack trace is below.
Informational] [xUnit.net 00:00:08.89] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[6/6/2019 9:19:53 AM Informational] [xUnit.net 00:00:08.89] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[6/6/2019 9:19:53 AM Error] [xUnit.net 00:00:08.91] Should_Call_UpdateAuditableProperties [FAIL]
[6/6/2019 9:19:53 AM Informational] [xUnit.net 00:00:08.92] Telerik.JustMock.Core.ElevatedMockingException : Cannot mock 'Void UpdateAuditableProperties()'. The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
* C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Dynamic Code Coverage Tools\amd64\covrun64.dll (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.
[6/6/2019 9:19:53 AM Informational] [xUnit.net 00:00:08.92] Stack Trace:
[6/6/2019 9:19:53 AM Informational] [xUnit.net 00:00:08.92] at Telerik.JustMock.Core.ProfilerInterceptor.ThrowElevatedMockingException(MemberInfo member)
[6/6/2019 9:19:53 AM Informational] [xUnit.net 00:00:08.92] at Telerik.JustMock.Core.MocksRepository.AddArrange(IMethodMock methodMock)
The problem you experience is reproduced when the VS Code Coverage is started. As I already said in my previous post, we are aware of this problem. In fact we started working on a fix. You could subscribe to the bug report item in the feedback portal to receive status updates: Code coverage not working with Visual Studio 2019
Regards,
Mihail
Progress Telerik

Hi Mihail,
I have JustMock version R2 2019 SP1 and I'm still experiencing this issue:
```
The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
* {9317ae81-bcd8-47b7-aaa1-a28062e41c71} (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.
```
Regards,
Ivo
Progress Telerik

Hi Ivo,
That solved my issue. Thanks for the assistance!
Regards,
Ivo
Progress Telerik

I'm running into a similar situation trying to get this profiler working however I do NOT have the ability to open visual studio and click on things? I'm currently running this on a headless build slave, where I have the build agent running as "nt authority\system."
This slave also had some churn on it in terms of having to reinstall visual studio 2015 enterprise, is there some other step I need to account for to restore things?
As an FYI I have a diagnostic script to see if the various environment variables are set for the profiler:
write-host "COR_ENABLE_PROFILING: $($env:COR_ENABLE_PROFILING)"
write-host "JUSTMOCK_INSTANCE: $($env:JUSTMOCK_INSTANCE)"
write-host "COR_PROFILER: $($env:COR_PROFILER)"
whoami
When I run this on my build slave it presents me with:
COR_ENABLE_PROFILING: 1
JUSTMOCK_INSTANCE: 1
COR_PROFILER: {B7ABE522-A68F-44F2-925B-81E7488E9EC0}
nt authority\system
I have noticed that you have opened another thread about your issue. I will answer you there.
Regards,
Mihail
Progress Telerik