Visual Studio 2022 Extension providing a full F5 experience for debugging .NET based applications on Linux based targets.
Visual Studio supports only 'attach to process via SSH'. This extension allows you to deploy and start .NET applications with the debugger attached via an SSH connection.
The extension integrates with the Visual Studio 2022 .NET project system providing an additional launch profile.
The desktop side SSH support relies on the built-in OpenSSH for Windows starting Windows 10 1809
The extension supports
- SSH authentication using private keys.
- Debugging .NET framework dependant and self contained application.
- Deploying the project output folder via SCP to the target device.
- Publish (running dotnet publish) before deploying the application.
- Installing vsdbg automatically (configurable).
- Installing .NET on the target device.
- Supporting command to setup SSH authentication.
To use this extension, you need a Windows based PC with:
- Window 10 x64 1809 or newer
- OpenSSH for Windows client
- Visual Studio 2022 17.4 or newer with any of the .NET workloads installed like
- .NET desktop development
- ASP.NET and web development
- .NET Multi-platform AppUI development
The extension depends on the following packages.
- .NET package dependencies
- Bash (required if the plugin shall install .NET on the device)
- OpenSSH server
- unzip
- cURL
Install the missing tools using your favorite package manager.
sudo apt install openssh-server unzip curl
To use the plugin, follow the steps below.
Open Visual Studio 2022, navigate to Tools -> Options -> Remote Debugger Launcher -> Device Configure the default values for Credentials, Folders and SSH setting. These values will be applied if the Launch Profile does not configure them.
Load a Visual Studio Solution holding at least one .NET 6 based application. Open the project 'Debug Properties' dialog. Click 'new launch profile' and select 'SSH Remote Launch'
The extension needs at the following settings to be configured either in the launch profile or the global options. The value specified in the launch profile will always override the global config.
Value | Configuration Source |
---|---|
Host name | Launch profile |
User name | Launch profile, Global options |
Private key | Launch profile, Global options |
Follow the guidelines in SSH Key Pair to create the required keys for SSH authentication.
Select the newly created profile as the active launch profile.
Open the solution 'Configuration Manager', Select the projects you want to build and/or deploy.
The plugin expects .NET to be installed on the target. You can use the support commands unter Tools -> Remote Debugger Launcher to install .NET and/or the VS Code Debugger (vsdbg).
Alternativly, install
- .NET as described in MS Learn: Install .NET on Linux
- vsdbg as described in Offroad Debugging of .NET Core
The 'Start Debugging' (F5) will perform the following steps
- Deploys the project ouput directory recursivly to the configured folder on the target using secure copy (SCP).
- If configured, installs vsdbg
- Launches the debugging session
The Remote Debugger Launch Extension Visual Studio extension and associated tools are licensed under the MIT license.
We welcome contributions!
- Contributing explains what kinds of contributions we welcome.
Additional documentation can be found in the docs folder.