Wednesday, February 2, 2022

[SOLVED] Cannot use visual studio 2019 ssh debug with raspberry pi 4

Issue

I'm using Visual Studio and Raspberry PI 4 for my personal project. For now, I'm making a small console application and successfully copied and ran on Raspberry PI 4 I'm following this tutorial to setup remote debugger from Visual Studio 2019 to my Raspberry PI 4.

Everything seemed to be fine, until I Attach to process When I entered my Raspberry information and click on Connect, there is one error popup appeared:

enter image description here

Unable to connect to pi@raspberrypi. An operation is not legal in the current state.

With the input information, I can remote to my Raspberry normally.

Anything wrong with my settings ?

Thank you,


Solution

Thanks to Alan Shurack (from the microsoft forums) there is a workaround for the problem of the Ssh debugging in Visual Studio 2019 [16.7.2] (It defenetly worked at version [16.5.4])

Workaround:

Adding and connecting to the connection under Tools->Options->Cross Platform->Connection Manager will solve the problem.

Search for "Edit and Set Default Remote SSH Connections" in the release notes: https://devblogs.microsoft.com/visualstudio/visual-studio-2019-v16-7-releases/

The issue with visual studio is being fixed and can be viewed in this thread https://developercommunity.visualstudio.com/content/problem/1161746/attach-to-process-using-ssh-not-working-visual-stu.html



Answered By - Green Fire
Answer Checked By - Clifford M. (WPSolving Volunteer)