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

Profiler error when running from powershell

2 Answers 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 10 Jan 2018, 01:08 AM

Hello,

I'm trying to write a powershell script to run my tests, create code coverage using OpenCover and then generate a report using ReportGenerator.  However I'm running into the Profiler error:

The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
*  (from process environment)

 

This only happens when run from the powershell, if I run it from command line the tests run fine.  The command I am using is:

packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -mergebyhash -target:"%VS140COMNTOOLS%\..\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" -targetargs:"JustMockUnitTests\bin\x64\Debug\JustMockUnitTests.dll /InIsolation /platform:x64 /logger:trx /Parallel" -output:"OpenCover.xml"

 

Any thoughts would be much appreciated.

 

Thanks

-Steve

2 Answers, 1 is accepted

Sort by
0
Accepted
Mihail
Telerik team
answered on 12 Jan 2018, 03:43 PM
Hello Steve,

Thank you for contacting us.

You can use the JustMockRunner.exe executable to wrap your process in order to be able to execute mocked tests with the console. Here is a help article explaining how this should be done from Command Prompt, but the concept is the same for PowerShell as well.


Regards,
Mihail
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Steve
Top achievements
Rank 1
answered on 18 Jan 2018, 04:42 PM

Thanks Mihail!

I was able to continue using my command by adding calls to set the environment variables mentioned in the link you provided.  I updated my powershell script to set those variables and then my call was successful.

Tags
General Discussions
Asked by
Steve
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Steve
Top achievements
Rank 1
Share this question
or