24

I am writing some tests using XUnit framework and have to use some external code referenced through a dll.

When I try to step into the method call, helper.GetEntity(), I get the following window and the execution exits.

[Fact]
public void PassingTest()
{
    var datapointJson = File.ReadAllText(@"sample.json");
    dynamic datapointObject = JsonConvert.DeserializeObject(datapointJson);

    // This is referenced from a different project in the same solution.
    var helper = new Helper.Actions();
    var studentEntity = helper.GetEntity("tom");
}

Execution.cs not found

Does anyone know why this is happening?

6
  • Can't you just click on Continue? That's not really an error, it's only a debugging message Commented Jan 5, 2018 at 9:38
  • 2
    I did and it exits out. Commented Jan 5, 2018 at 9:42
  • Well, that's the last line of the test, so it makes sense that it exits (there's nothing more to run) Commented Jan 5, 2018 at 9:43
  • 8
    Do you have Just my Code enabled or disabled? Toggle that option, that should be the problem Commented Jan 5, 2018 at 9:51
  • 1
    @Camilo That was it. Thanks and appreciate your time and help. Commented Jan 5, 2018 at 10:08

2 Answers 2

28

(posting @camilo-terevinto's comment as answer)

Turn on 'Enable Just My Code' in Visual Studio | Tools | Debugging | General.

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

But what is exactly happening?
I just got this with VS2017 and Resharper 2018.3.4. It didn't help to check "Enable Just My Code". It was enabled, I disabled it tried again and then re-enabled it and tried once more but it still stops. Has anyone else seen this recently?
@JohanBergens experiencing the same thing, and still haven't found a solution (2 days searching and counting..) :(
@JohanBergens actually I managed to fix it. See my answer below
3

So I have been also struggling for 2 days with this one and nothing what I have found online helped me, but the answer of @pauldendulk guided me to the solution. Under Options -> Debbuging -> Just-in-Time I noticed that the "Managed" check box was unmarked and there was an warning label saying something like "multiple debuggers manes code ... please repair Visual Studio to restore ..." (sorry I didn't capture a screen shot and don't remember the right wording, but it was with that context).

After running repair of Visual Studio 2017 (Community Edition) via the "Visual Studio Installer" the test debugging worked like expected.

1 Comment

Had the same issue with debugging XUnit tests, didn't get the warnings you mention. Running repair of the Visual Studio helped, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.