【问题标题】:Remote debugging - Windows PDB are not supported by .NET Core debugger - how to publish correctly?远程调试 - .NET Core 调试器不支持 Windows PDB - 如何正确发布?
【发布时间】:2019-12-27 08:43:03
【问题描述】:

我正在 Windows 上的 .NET Core 2.1 中编写 ASP.NET Core APP,并在使用后将其部署到服务器上

dotnet publish --configuration Debug -r linux-x64 我无法通过SSH 上的远程调试器进行连接

因为:

WARNING: Could not load symbols for 'Common.dll'. '/home/dev/Common.pdb' is a Windows PDB. These are not supported by the cross-platform .NET Core debugger.

为什么会发生?以及我必须如何发布才能远程调试它?

【问题讨论】:

  • 项目 > 属性 > 构建选项卡 > 高级按钮 > “调试信息”设置。在 asp.net.core 项目中出现这个错误是很奇怪的,IDE 和项目模板可以让你摆脱这样的基本问题。

标签: c# .net-core deployment


【解决方案1】:

.NET Core 中的所有平台仅支持可移植 PDB。您必须在 csproj 文件中启用它们

 <DebugType>portable</DebugType>

您还可以查看documentation 并关注一些文章,例如thisthis,解释如何使用vsdbg 通过SSH 设置这种调试

【讨论】:

    猜你喜欢
    • 2010-09-27
    • 2011-06-20
    • 2018-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-24
    • 1970-01-01
    • 2011-02-13
    相关资源
    最近更新 更多