VsLinuxDebug icon indicating copy to clipboard operation
VsLinuxDebug copied to clipboard

Unable to auto-attach to debugger

Open Redns opened this issue 3 years ago • 9 comments

Hey, thank you very much for developing this plugin. I have encountered some problems in the process of using it and I hope to get your help. Here is my Linux system information and I have followed the tutorial to install dotnet、openssh-server and curl

Linux VM-0-16-ubuntu 4.15.0-159-generic #167-Ubuntu SMP Tue Sep 21 08:55:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

And this is the error message image

The console output image

The code is compiled locally.

Redns avatar May 19 '22 14:05 Redns

From the looks of it, you have a solid connection and it uploaded/decompressed your project which is great.

This is a known issue w/ remote debugging and unfortunately Microsoft's VSDbg doesn't provide much documentation or feedback other than failing to launch. I have seen firewall issues in the past blocking port access (see 'Additional Resources' below). Also, I've had success debugging console apps on Ubuntu 20.04, but issues on 22.04.

To try and help you out:

  • Which version of VS Linux Debugger are you using?
  • Which version of Ubuntu are you using?
  • Are you able to manually launch and Attach to Process via VS > Debug > Attach to Process...?
    • For console apps, you may need to perform, var _ = Console.ReadLine(); and set a breakpoint to it before launching.
  • Ensure your app is configured for remote debugging.

Additional Resources:

DamianSuess avatar May 20 '22 15:05 DamianSuess

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 03 '22 20:06 stale[bot]

Sorry for reopening this issue, but I'm having this exact issue but on the latest version of raspbian instead...

My console output looks exactly like the one provided by the original author and the error popup I get is also the same. I have allowed the VS2022 port (4026) trough the firewall on the pi. I have also made sure the app is configured for remote debugging.

I can attach to the process via VS > Debug > Attach To Process, works just fine. I have also tried adding: var _ = Console.ReadLine();

As the first line in my Main();

None of these options have been able to resolve my problem. Any more suggestions?

TGlev avatar Jan 31 '23 13:01 TGlev

After some more digging I found this in the debug adapter host log: ERROR: Debug adapter error output: bash: line 1: /home/retina/.vs-debugger/vs2022: Is a directory

However, I do not understand how to fix this... :)

TGlev avatar Jan 31 '23 20:01 TGlev

If I change the launch json adapterArgs -T argument from: ~/.vsdbg/vs2022 to ~/.vsdbg/vs2022/vsdbg

and then launch the debug manually with the command window and command: DebugAdapterHost.Launch /LaunchJson:"path-to-launch.json" /EngineGuid:541B8A8A-6081-4506-9F0A-1CE771DEBC04

it seems to get further... Seems to me, but Im not sure, that the exported path to vsdbg is incorrect in my launch.json.

TGlev avatar Jan 31 '23 21:01 TGlev

thank you @TGlev, reopening this issue. If you have time, please feel free to jump in to address this issue. Unfortunately, been known to be temperamental between environment-to-environment.

DamianSuess avatar Feb 02 '23 21:02 DamianSuess

thank you @TGlev, reopening this issue. If you have time, please feel free to jump in to address this issue. Unfortunately, been known to be temperamental between environment-to-environment.

Thanks. Im afraid my knowledge doesnt include visual studio extensions. Havent been able to figure much out regarding this issue on my own.

TGlev avatar Feb 21 '23 12:02 TGlev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 07 '23 18:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 25 '23 03:04 stale[bot]