Using JustMock outside of test runners/ visual studio

2 posts, 0 answers
  1. Ben Jones
    Ben Jones avatar
    12 posts
    Member since:
    Jun 2009

    Posted 17 Dec 2015 Link to this post

    I'm wondering whether I am simply trying to achieve the impossible, but.....

    I have successfully mocked up some legacy code and able to run my tests. I have then built a simple WPF app to utilise the same mocking approach and publish the results (without using test fixtures)

    However, when I try to run the app outside of visual studio, I get the following exception:


    Message=Cannot mock 'System.String get_blah()'. The profiler must be enabled to mock, arrange or execute the specified target.

    I have checked the event viewer and the profiler is enabled.

    Is this issue simply that this will never run outside of Visual Studio/any other test runner?

    Ideally, we would like to be able to create a suite of automated regression testing apps for non-devs to use.


    Kind Regards



  2. Stefan
    Stefan avatar
    198 posts

    Posted 17 Dec 2015 Link to this post

    Hello Ben,

    When running outside of Visual Studio, you should follow the steps in our integration articles in the documentation.

    My guess is that the actual event in the event log states that the profiler requested to not be activated. Most likely, the JUSTMOCK_INSTANCE environment variable isn't set at the point where you run the tests.


    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
Back to Top