Skip to content

Debugging Manually

Damian edited this page Oct 15, 2022 · 4 revisions

Manual Debugging

In most cases, you should be able to automatically debug via Build, Deploy and Debug. However, some Linux distros or configurations can be troublesome, causing some developers to do a semi-manual debugging process.

To debug Linux GUI applications debugging, a solution is currently in progress. For now, you'll have to use this semi-automated process.

Steps

For Console apps only, perform the following:

  • In the app's Main() add the line, Console.ReadLine() at the beginning.
  • This can be surrounded by #if DEBUG to ensure this doesn't go into your software Releases
  1. (VS) Linux Debugger > Build and Deploy
  2. Run the app on the remote machine via, dotnet MyApp.dll
  3. (VS) Debug > "Attach to Process..."
  4. Select Connection Type, SSH
  5. Set the Connection Target: "UserName@IPADDRESS". Press, <enter>
    • Input user credentials. Click, Connect
    • If prompted with Accept Host Key, click, Yes
  6. Select your Process and click, Attach
    • Process is dotnet, and Title will be the command you typed.
  7. Check, Managed (.NET Core for Unix)
  8. Click, OK

Next Visual Studio will briefly show a pop-up stating, "Launching debugger adapter..." and hit your breakpoint

Extended Debugging

* Click, **Find**
* If prompted, accept the Window Defender Firewall prompt, clicking appropriate boxes (_both Private and Public if applicable_)
Clone this wiki locally