Cannot remote debug WSL2 C/C++ program with Visual Studio 2022 Cross-Platform settings

Buddhika 0 Reputation points
2023-09-29T09:59:58.07+00:00

Please follow with images attached below:
System: WSL2 Ubuntu 22.04, user - macxfadz , Visual Studio 2022 - Version 17.7.4
Screenshot 2023-09-29 142855

Screenshot 2023-09-29 143047

Screenshot 2023-09-29 144447

Screenshot 2023-09-29 144358

Screenshot 2023-09-29 144515

Screenshot 2023-09-29 150439

Screenshot 2023-09-29 144637

Screenshot 2023-09-29 144724


This is the problem it's unable to start debugging stating that - Unable to establish the GDB session, also Remote File Explorer is always empty never displayed WSL2 files as VSCode to as following:
Screenshot 2023-09-29 145836


These are status of SSH connection establishment done vis latest PowerShell 7.3.7 terminal and WSL2
Screenshot 2023-09-29 144825

Screenshot 2023-09-29 144911

Screenshot 2023-09-29 145515

ConnectedScreenshot 2023-09-29 145539


When we use inbuilt WSL2 GCC/CLANG toolset no issues.

Screenshot 2023-09-29 145625

Screenshot 2023-09-29 145653

Please describe to how to fix this issue when we trying to Remotely debug using visual studio 2022? and explorer remote WSL2 files using visual sutido 2022 Remote File Explorer utility?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,888 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,636 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
967 questions
{count} votes