====== Remote .NET Debugger Visual Studio 2022 & 2026 Extension ====== Although it is possible to [[https://learn.microsoft.com/en-us/dotnet/iot/debugging?tabs=self-contained&pivots=visualstudio|manually deploy, launch, and attach a debugger]] to a .NET 5+ application running on a remote device like the ComfilePi, Visual Studio 2022 & 2026 do 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. This extension is for .NET 5 and later. If you need a debugger for .NET Framework 4.x and Mono, use our [[:comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:index|Remote Mono Debugger Visual Studio Extension]]. ===== Download and Install ===== ^ ^ Date ^ Release Notes ^ | {{ https://downloads.comfiletech.com/ComfilePi/remote_dotnet_debugger/comfiletech.remotedotnetdebugger_v1.5.vsix|ComfileTech.RemoteDotnetDebugger_v1.5.vsix}} | 2026-01-28 | [[.:release_notes:index|Release Notes]] | | {{ https://downloads.comfiletech.com/ComfilePi/remote_dotnet_debugger/comfiletech.remotedotnetdebugger_v1.4.vsix|ComfileTech.RemoteDotnetDebugger_v1.4.vsix}} | 2025-09-24 | [[.:release_notes:index|Release Notes]] | | {{ https://downloads.comfiletech.com/ComfilePi/remote_dotnet_debugger/comfiletech.remotedotnetdebugger_v1.3.vsix|ComfileTech.RemoteDotnetDebugger_v1.3.vsix}} | 2025-07-21 | [[.:release_notes:index|Release Notes]] | | {{ https://downloads.comfiletech.com/ComfilePi/remote_dotnet_debugger/comfiletech.remotedotnetdebugger_v1.2.vsix|ComfileTech.RemoteDotnetDebugger_v1.2.vsix}} | 2025-06-04 | [[.:release_notes:index|Release Notes]] | | {{ https://downloads.comfiletech.com/ComfilePi/remote_dotnet_debugger/comfiletech.remotedotnetdebugger_v1.1.vsix|ComfileTech.RemoteDotnetDebugger_v1.1.vsix}} | 2025-04-29 | [[.:release_notes:index|Release Notes]] | 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|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 public/private keys. For the ComfilePi and other Raspberry Pi devices, this can be configured very easily using the [[https://www.raspberrypi.com/software/|Raspberry Pi Imager]] program when [[comfilepi:raspbian:index|installing a new OS image]]. | {{:comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:pi_imager_1.png?450|}} | {{:comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:pi_imager_2.png?450|}} | For more information see [[https://www.raspberrypi.com/documentation/computers/remote-access.html#ssh|Raspberry Pi's documentation]]. Verify SSH authentication between the Windows development PC and the remote device using the ''ssh'' command in a Windows terminal. It should not prompt for a password. {{ :comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:test_ssh.mp4?900x506 |}} ===== Installing vsdbg ===== The remote device must have the ''vsdbg'' utility installed. ==== Bookworm ==== If using our ComfilePi 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: - Run ''wget https://aka.ms/getvsdbgsh'' to download the installation script. - Run ''chmod +x getvsdbgsh'' to make the script executable. - 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. {{ :comfilepi:dotnet_core_development:remote_debugger:config_launch_profile.mp4?900x608 }} ===== Troubleshooting ===== If you encounter problems, please check the "Remote .NET Debugger" output window pane. {{ :comfilepi:dotnet_core_development:remote_debugger:remote_net_debugger_output.png }}