如何在Azure App Service上调试类库?

问题描述 投票:0回答:1

我有一个在 Azure 中运行的 .NET 应用程序。它有一个链接到它的库,但它的源代码位于单独的解决方案中,我需要调试这个库。如何在 Azure 中链接该库并连接调试器?

azure visual-studio debugging azure-web-app-service
1个回答
0
投票
  • 在.Net应用程序中,右键单击Reference文件夹并浏览您的类库,然后从类库的bin文件夹中选择dll文件(
    YourClassLibraryName.dll
    )。

enter image description here

  • dll 引用将添加到 .Net Application
    Reference
    文件夹中。
  • 构建并重新部署 .Net 应用程序。
  • 如果您有项目的依赖项,使用 Visual Studio 进行部署(通过发布配置文件)将自动上传项目的所有依赖项目/库。
  • 发布您的解决方案将自动发布您的 dll。
  • 项目发布时,bin文件夹及其内容会被复制到目标机器。
  • 发布应用后,检查bin文件夹中是否存在所有文件和dll
Path - Azure Portal=>Azure Web App=>Advanced Tools=>Go=>Debug Console=>CMD=>site=>wwwroot=> bin

您可以看到扩展名为

.dll
.pdb

的引用 dll

enter image description here

  • 在 VS 中,添加类库的命名空间并在代码中您想要的位置设置断点。
  • 要开始调试,请按 F5。 Visual Studio 将识别模块加载,加载符号,然后在断点处停止。

enter image description here

  • 在 Visual Studio => Net 应用程序 => 在发布窗口 => 托管设置 => 单击“附加调试器”选项

enter image description here

enter image description here

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