Step through debugging of code running in Kubernetes using VS2019 SSH attach (Part 2)
SteveSims2
Posted on May 21, 2021
Get your desktop ready for debugging
Ok now, open Visual Studio 2019, and get the sources that match the code running on your pod. Compile them. Set the project for your app as the Startup Project. Choose Debug -> Attach to Process.
Choose SSH
Click the Refresh Button
Fill out the fields in the dialog with the master node name, the port of the SSH service, the root account and the password that you assigned to the root account. Press Connect
Choose the dotnet
process and click Attach
Check Managed (.Net Core for Unix)
and press OK
.
Set a breakpoint in the run loop of the code, and wait. When that line executes the code will break:
From this point you can step, hover over variables, or anything you might do when debugging locally.
Posted on May 21, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.