Profiler error when running from powershell

3 posts, 1 answers
  1. Steve
    Steve avatar
    2 posts
    Member since:
    Nov 2016

    Posted 09 Jan Link to this post

    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. Answer
    Mihail
    Admin
    Mihail avatar
    242 posts

    Posted 12 Jan Link to this post

    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
  3. Steve
    Steve avatar
    2 posts
    Member since:
    Nov 2016

    Posted 18 Jan Link to this post

    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.

Back to Top