DEV Community

SteveSims2
SteveSims2

Posted on

1

Step through debugging of code running in Kubernetes using VS2019 SSH attach (Part 2)

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.
Alt Text
Choose SSH
Click the Refresh Button
Alt Text
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
Alt Text
Choose the dotnet process and click Attach
Alt Text
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:
Alt Text
From this point you can step, hover over variables, or anything you might do when debugging locally.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay