首页 > 解决方案 > ASP.NET Core 项目中未命中断点

问题描述

我在调试 ASP.NET Core 项目时遇到问题。这是关于https://github.com/jasontaylordev/CleanArchitecture的。您可以使用“dotnet run”启动它。我从“dotnet run waitfordebugger”开始。

这是主要方法的片段。该程序休眠 20 秒,以便我可以将 Visual Studio 附加到该进程。

public async static Task Main(string[] args)
        {
            if (args[0] == "waitfordebugger")
            {
                Thread.Sleep(20000); // Wait 20 Seconds
            }
            int i = 0;
            i++;

我在 vs 中的“i++”处设置了一个断点,使用“dotnet run waitfordebugger”启动应用程序,并将 vs 附加到进程中。问题是没有命中断点。我收到这个警告:“断点当前不会被命中。没有为此文档加载任何符号。”。有任何想法吗?

标签: c#asp.net-coredebuggingbreakpoints

解决方案


推荐阅读