我最近从 .NET Core 3.1 迁移到了 .NET 5.0 ( using isolated/out-of-process runtime ),用于 C# 中的 Azure Function 项目。一切都按预期工作。然而,每当我调试时,我的断点都没有命中。为什么我现在不能调试我的 Azure Function 应用程序,但我以前可以?
最佳答案
有一个简单的方法!
public static class Program
{
public static void Main()
{
Debugger.Launch(); // The trick! <<=======================================
using var host = new HostBuilder()
...
然后像往常一样启动而不调试 (Ctrl+F5) 并将相同的 Visual Studio 实例附加到 dotnet
进程瞧,您调试了您的功能!
关于c# - 如何在 Visual Studio 中使用 .NET 5(独立进程)调试 Azure Functions?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67526631/