步进代码时找不到ExecutionTimer.cs

问题描述 投票:13回答:2

我正在使用XUnit框架编写一些测试,并且必须使用通过dll引用的一些外部代码。

当我尝试进入方法调用helper.GetEntity()时,我得到以下窗口并且执行存在。

[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

有谁知道为什么会这样?

问候。

c# xunit.net
2个回答
9
投票

(发布@ camilo-terevinto的评论作为答案)

在Visual Studio中打开“启用我的代码”工具|调试|一般。

enter image description here


1
投票

所以我也一直在努力争取这一天,我在网上找到的任何东西都没有帮助我,但@pauldendulk的回答引导我找到解决方案。在选项 - > Debbuging - > Just-in-Time中,我注意到“Managed”复选框没有标记,并且有一个警告标签,上面写着“多个调试器鬃毛代码......请修复Visual Studio以恢复......” (对不起,我没有捕捉到屏幕截图,也没有记住正确的措辞,但它是在那个背景下)。

通过“Visual Studio Installer”运行Visual Studio 2017(Community Edition)修复后,测试调试按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.