【问题标题】:MIEngine Debugging works for Launch but not Attach on LinuxMIEngine 调试适用于 Launch 但不适用于 Linux 上的 Attach
【发布时间】:2017-10-17 04:46:37
【问题描述】:

我有一个项目,我一直在使用 MIEngine 和 clrdbg 在 Linux 上进行调试。当我从 Visual Studio 启动应用程序时,调试器连接良好并且我的断点被命中。如果我将应用程序作为系统启动的守护进程运行,Visual Studio 似乎允许我将调试器附加到进程,但输出窗口中没有输出(除了解释允许我进行调试的初始标题之外)工具),我的断点都没有被命中。

无论哪种方式,我都在使用 VS2015 并在命令行窗口中使用 Debug.MIDebugLaunch。这是我的选项文件的样子...

从 Visual Studio 启动应用程序:

<?xml version="1.0" encoding="utf-8" ?>
<PipeLaunchOptions xmlns="http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014"
  PipePath="path-to\plink.exe" PipeArguments="-i path-to\ssh-debug.ppk user@machinename -batch -t ~/clrdbg/clrdbg --interpreter=mi"
  TargetArchitecture="x64" MIMode="clrdbg" ExePath="dotnet" WorkingDirectory="~/workingDirectory" ExeArguments="ApplicationName.dll">
</PipeLaunchOptions>

对于从 Visual Studio 附加到正在运行的应用程序(如果我重新启动服务并且它出现在不同的 ID 下,我会更改 ProcessId):

<?xml version="1.0" encoding="utf-8" ?>
<PipeLaunchOptions xmlns="http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014"
  PipePath="path-to\plink.exe" PipeArguments="-i path-to\ssh-debug.ppk user@machinename -batch -t ~/clrdbg/clrdbg --interpreter=mi"
  TargetArchitecture="x64" MIMode="clrdbg" ProcessId="19036">
  <LaunchCompleteCommand>None</LaunchCompleteCommand>
</PipeLaunchOptions>

关于可能发生的事情或我缺少什么的任何想法? 这是一个错误,还是我可能需要更新一些东西?

编辑: 我将“附加”选项文件更改为如下所示:

<?xml version="1.0" encoding="utf-8" ?>
<PipeLaunchOptions xmlns="http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014"
  PipePath="path-to\plink.exe" PipeArguments="-i path-to\ssh-debug.ppk user@machinename -batch -t ~/clrdbg/clrdbg --interpreter=mi --attach 19036"
  TargetArchitecture="x64" MIMode="clrdbg">
  <LaunchCompleteCommand>None</LaunchCompleteCommand>
</PipeLaunchOptions>

它可以工作,但现在我不知道如何在不终止进程的情况下分离调试器。

【问题讨论】:

    标签: c# visual-studio debugging visual-studio-2015 asp.net-core


    【解决方案1】:

    安装 Visual C++ for Linux Development 已解决此问题,并使其与 PipeLaunchOptions 的 ProcessId 属性一起正常工作。

    【讨论】:

    • 感谢您在这里分享您的解决方案,您可以将其标记为答案,这样可以帮助遇到相同问题的其他社区成员。
    • 完成。上次我坐在办公桌前时,我无法将其标记为解决方案。 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-09
    • 2011-10-27
    相关资源
    最近更新 更多