我可以使用 VS Code 连接到 Azure 中的 .Net 6 Web 应用程序 运行 来设置断点和调试吗?

Can I connect to my .Net 6 web app running in Azure with VS Code to set breakpoints and debug?

我已将我的 .Net6 网络应用程序(Angular 前端)推送到 Azure,我可以连接到 url 并查看和 运行 网站。

问题 - 我想知道是否有办法在 Azure 中测试实例 运行ning 并在我的一个控制器上设置断点并进行调试?这可能来自 VS Code 吗?如果是这样,我该怎么做,是否有 link 某处有教程可以帮助我入门?

仅供参考 - 我目前在 VS Code 中安装了 Azure 扩展。我用它 push/publish 到 Azure 的应用程序。当我右键单击应用程序服务时,我可以看到有一个名为“开始远程调试”的选项。我单击它,但 VS 在左下角显示一条错误消息,提示“Azure 远程调试目前仅支持 Linux 上的 Node.js 应用程序。”我没有使用 Linux。我相信我的服务器 运行 宁应用程序是一个 Win 服务器,我因为它是一个 .Net 6 应用程序,它在服务器端使用 .Net,而不是 Node。

这似乎是我想要的,但它适用于 Visual Studio,而不是 Visual Studio 代码。 link

我还在应用服务的配置部分将 'Remote Debugging' 设置为 'On'。但它只显示 Visual Studio 版本,没有显示 VS Code。这是否意味着不再使用 VS Code?

I want to know if there is a way to test the instance running in Azure and set a breakpoint on one of my controllers and debug it? Is this possible from VS Code? If so how would I do it and is there a link somewhere with a tutorial to get me started

根据目前的 visual studio code documentation,vscode 仅支持远程调试 Node.js 应用程序。它不支持远程调试:这是调试扩展的一个特性。

如果您想调试 .Net 6 应用程序,我们建议您使用 Visual studio 而不是 visual studio 代码。

有关Remote debug ASP.net core on Azure or this 线程

的更多信息,您可以参考此文档

I've also set the 'Remote Debugging' to 'On' in the configuration section of the app service. But it only shows a Visual Studio version, nothing for VS Code. Does this mean no go for VS Code?

是的,目前仅 Visual studio 支持远程调试。