User Tools

Site Tools

한국어

comfilepi:dotnet_core_development:remote_debugger:index

This is an old revision of the document!


Remote .NET Debugger Visual Studio Extension

Although it is possible to manually deploy, launch, and attach a debugger to a .NET 5+ application running on a remote device like the ComfilePi and jPC, Visual Studio does not have a built-in way to perform all three functions in a single motion.

To fill this void in Visual Studio, we have developed a Remote .NET Debugger Visual Studio extension that enables one to deploy, launch, and debug .NET applications on a remote device, all from within Visual Studio, at the click of a button, or an “F5” keystroke.

Download and Install

To install, simply close all instances of Visual Studio, and double-click on the .vsix file.

Requirements

Development PC

  • Windows 10 or later, 64-bit
  • Visual Studio 2022 or 2026

Target Device

  • A running SSH daemon
  • Installed .NET runtime or SDK
  • Installed instance of vsdbg. See Installing vsdbg for instructions.

SSH Authentication

For security reasons, the OpenSSH implementation installed on Windows does not permit authenticating with hard-coded passwords. Therefore, for this extension to work, authentication between the Windows development PC and the remote device must be configured using Setup passwordless SSH login.

  1. On your development PC, generate a key pair
    ssh-keygen -t rsa

    The key pair will likely be stored in your user profile's home directory (i.e. $HOME/.ssh or on Windows C:\Users\{Username}\.ssh).

  2. Copy the public key to the panel PC. Don't miss the trailing colon.
    scp $HOME/.ssh/id_rsa.pub {user}@{panel_pc_ip_address}:
  3. Register the public key as an authorized key on the panel PC: Run
    mkdir .ssh && cat id_rsa.pub >> .ssh/authorized_keys
  4. The next time you start an SSH session from your remote device, you should not be asked to authenticate with a password.

Installing vsdbg

The remote device must have the vsdbg utility installed.

Trixie and Bookworm

If using our ComfilePi Trixie and Bookworm OS, vsdbg is installed by default to /opt/Microsoft/vsdbg/vsdbg. If it is not installed it can be installed by running sudo apt install cpi-vsdbg.

Other OS Variants

Install vsdbg by following this procedure:

  1. Run wget https://aka.ms/getvsdbgsh to download the installation script.
  2. Run chmod +x getvsdbgsh to make the script executable.
  3. Run sudo ./getvsdbgsh -v latest -l /opt/Microsoft/vsdbg to install vsdbg.

You can change the installation location to whatever you want, but you must remember the location when configuring the launch profile.

Configuration and Usage

After installing the extension and verifying SSH communication between the Windows development PC and the remote device all that's required is to add a new .NET Remote Debugger launch configuration profile to the project.

For most use cases, only the “Remote Machine”, “Remote User”, and “Path to vsdbg” are needed. “Path to vsdbg” must be the path to the vsdbg executable, not the installation folder. So, for example, if you installed vsdbg to /opt/Microsoft/vsdbg you will need to enter /opt/Microsoft/vsdbg/vsdbg for the path to the executable.

Troubleshooting

If you encounter problems, please check the “Remote .NET Debugger” output window pane.

comfilepi/dotnet_core_development/remote_debugger/index.1781232441.txt.gz · Last modified: by mfranklin