-
Notifications
You must be signed in to change notification settings - Fork 13
Debugging Manually
Damian edited this page Oct 15, 2022
·
4 revisions
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.
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
- (VS) Linux Debugger > Build and Deploy
- Run the app on the remote machine via,
dotnet MyApp.dll
- (VS) Debug > "Attach to Process..."
- Select Connection Type, SSH
- Set the Connection Target: "UserName@IPADDRESS". Press,
<enter>
- Input user credentials. Click, Connect
- If prompted with Accept Host Key, click, Yes
- Select your Process and click, Attach
- Process is dotnet, and Title will be the command you typed.
- Check, Managed (.NET Core for Unix)
- Click, OK
Next Visual Studio will briefly show a pop-up stating, "Launching debugger adapter..." and hit your breakpoint
* Click, **Find**
* If prompted, accept the Window Defender Firewall prompt, clicking appropriate boxes (_both Private and Public if applicable_)
Copyright 2023 Xeno Innovations, Inc.