【问题标题】:Visual Studio 2022 Debug On Remote Azure Server远程 Azure 服务器上的 Visual Studio 2022 调试
【发布时间】:2021-12-01 14:07:39
【问题描述】:

我似乎已在 Visual Studio 2022 中停用 Cloud Explorer。 这是我每天多次使用的东西,我会非常想念它。 我以前可以在 Cloud Explorer 中选择应用服务,右键单击,然后将调试器附加到应用。在 Visual Studio 2022 中,我找不到将调试器附加到远程 Azure 应用服务的方法。同时浏览网页我找不到任何有关如何执行此操作的文档。有人可以提供有关如何执行此操作的说明,或者将我指向有关如何在远程服务器上调试 Azure 应用程序的文档。

【问题讨论】:

    标签: azure-web-app-service remote-debugging visual-studio-2022


    【解决方案1】:

    目前有一个调试 Azure 应用服务的选项。
    您可以创建发布配置文件并从那里附加调试器,而不是使用云资源管理器:

    VS 2022 中的所有内容。

    【讨论】:

    • 我在 Azure Function 上使用过它,但是当我从 Postman 运行帖子时,它从未涉及到代码。还有其他方法可以启动 Azure Functions 的代码吗?
    • @OferGal 你能澄清一下'启动代码'是什么意思吗?
    • 我的意思是测试或调试在 Azure 中运行的代码并在从 Postman 发送帖子后发现错误
    • 刚才我发现在“发布”窗格中我可以使用“查看流日志”并在错误发生时查看错误
    【解决方案2】:

    您可以使用 Attach to Process 在 Visual Studio 中使用 GDB 或 LLDB 远程调试进程。

    使用 LLDB 附加到进程的功能是 Visual Studio 2022 Preview 中的新增功能。

    请关注Attach to a Remote Process with LLDB in Visual Studio 2022了解更多步骤。

    更新

    无法使用 Visual Studio 2022 调试适用于 Windows 的 Azure 应用服务

    将在即将发布的 Visual Studio 版本中支持针对 Azure 应用服务使用 Visual Studio 2022 远程调试器。目前,您可以使用 2017 和 2019 版本。

    请参考Visual Studio 2022 to debug Azure App Services for Windows

    【讨论】:

    • 我完全不熟悉 GDB 或 LLDB。该示例似乎都是关于连接到 Linux 系统的。不是远程 Azure 应用服务,托管在 Windows 中。
    • @Terry151151 - 更新了答案,请检查并告诉我。
    • @Terry151151 - 在处理此线程时(2021 年 10 月),没有选择使用 Visual Studio 2022 来调试适用于 Windows 的 Azure 应用服务。
    猜你喜欢
    • 1970-01-01
    • 2011-10-08
    • 2017-01-18
    • 2022-10-08
    • 2022-10-17
    • 2021-12-04
    • 2014-10-25
    • 2011-09-10
    • 1970-01-01
    相关资源
    最近更新 更多