====== Remote Mono Debugger Visual Studio 2022 Extension ====== Visual Studio 2022 does not have a built-in way of deploying, launching, and debugging .NET Framework Mono applications running remotely on a device like the ComfilePi. Although it is possible to do most debugging of .NET Framework applications on a Windows PC, prior to deploying to a remote device, it is only possible to debug features that are in common to both platforms. If the applications makes use of features unique to the remote device (e.g. GPIO) then it is not possible to debug those parts of the program from the Windows development PC. Furthermore, there are often cases where the program works well on the Windows development PC, but not on the remote device, and vice versa. Therefore, for the most convenient and productive development experience, it is best to have a way to debug a applications, from the development PC, as it is running on the remote device. To fill this void in Visual Studio 2022, we have developed a Remote Mono Debugger Visual Studio extension that enables one to deploy, launch, and debug .NET Framework applications on a remote device, from within the Visual Studio IDE, at the click of a button or an "F5" keystroke. This extension if for .NET Framework 4.x and Mono applications. If you need a debugger for .NET 5+ applications, use our [[:comfilepi:dotnet_core_development:remote_debugger:index|Remote .NET Debugger Visual Studio Extension]]. ===== Download and Install ===== ^ ^ Date ^ Release Notes ^ | {{ https://downloads.comfiletech.com/ComfilePi/remote_mono_debugger/comfiletech.remotemonodebugger_v1.1.vsix |ComfileTech.RemoteMonoDebugger_v1.1.vsix}} | 2025-04-25 | [[.:release_notes:index|Release Notes]] | To install, simply close all instances of Visual Studio, and double-click on the .vsix file. ===== Demonstration ===== The following video provides a full walkthrough demonstration of the extension.
===== Requirements ===== ==== Development PC ==== * Windows 10 or later, 64-bit * Visual Studio 2022 ==== Visual Studio Project ==== The Visual Studio project must be a .NET Framework 4.x project, and must be upgraded to an SDK-style project using the [[https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.upgradeassistant|Upgrade Assistant]]. Only upgrade to an SDK-style project; do not upgrade to .NET 5+. {{ :comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:upgrade_to_sdk.mp4?900x755 }} ==== Target Device ==== * A running SSH daemon * Mono 6.12 or later ==== 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 |}} ===== Configuration and Usage ===== After installing the extension, verifying SSH communication between the Windows development PC and the remote device, and upgrading the project to a .NET SDK-style project, all that's required is to add a new //Mono Remote Debugger// launch configuration profile to the project. For most use cases, only the ''Remote Machine'' and ''Remote User'' are needed. {{ :comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:mono_remote_debugger_add_profile.mp4?900x566 }} After the launch profile is configured, select it from list in the main toolbar, and press it. It will deploy the application to the remote machine, launch it, and attach the Visual Studio debugger all in a single motion. ===== Troubleshooting ===== If you encounter problems, please check the "Remote Mono Debugger" output window pane. {{ :comfilepi:running_.net_winforms_applications_with_mono:remote_mono_debugger:remote_mono_debugger_output.png }}