问题
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 exists.
[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");
}
Does anyone know why this is happening?
Regards.
回答1:
(posting @camilo-terevinto's comment as answer)
Turn on 'Enable Just My Code' in Visual Studio | Tools | Debugging | General.
回答2:
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 repai of Visual Studio 2017 (Community Edition) via the "Visual Studio Installer" the test debugging worked like expected.
来源:https://stackoverflow.com/questions/48110573/executiontimer-cs-not-found-when-stepping-into-code