Enables Visual Studio 2017 and Visual Studio 2019 to deploy and debug a .Net application on a remote Linux machine with mono installed over SSH.
Visual Studio 2019 Support
In Visual Studio 2019, extension menus are handled differently. "Mono" can now be found in the "Extensions" menu.
You have to save a valid SSH connection first!
-  Selects the connection to use for deploying and debugging
-  You can create a additional SSH connection
-  You can remove a SSH connection (The last connection can not be deleted)
-  Enter the remote SSH IP or host name
-  Enter the SSH port
-  Enter the SSH username
-  Enter the SSH password or private key file passphrase (if there is no password => leave the field empty)
-  Enter/set the filepath to a private key file (if there is no ssh private key authentication => leave the field empty)
-  Mono opens a debug session over this port
-  This is where the project output is deployed
-  If enabled you can create a JSON config file to overwrite the 'Remote Deploy Path'. (see below)
-  Timeout to connect to the debug session
-  Console outputs can be output in the Visual Studio Output window
-  All changes are saved after you click on "Save"
-  All changes are discarded if you click on "Cancel"
-  Change the default debugging scripts on tab "Debug scripts". (ex.: to add sudo)
-  Change the Pre-Debug script to kill old mono debug sessions
-  The default Pre-Debug script is loaded if you click on "Set default Pre-Debug script" or the input is empty
-  Change the Debug script to start a mono debug session
-  The default Debug script is loaded if you click on "Set default Debug script" or the input is empty
-  For further script information click on "Script information"
-  Information about all supported parameters
You can deploy your "Startup project" output to the remote machine via SSH configured under "Settings".
Menu "Mono"/"Deploy only (SSH)"
To speed up deployment, SshFileSync is used.
To upload only changed files, an additional cache file '.uploadCache.cache' is stored in the destination folder.
Don't delete this cache file!
You can start a debug session in Visual Studio 2017 on the remote machine.
Menu "Mono"/"Debug only (SSH)"
Deploy and Debug
You can run both commands in one step.
Menu "Mono"/"Deploy and Debug (SSH)"
Attach to mono debugger (without SSH)
You can debug a mono process that is already waiting for a debugger. SSH is not necessary. Only one TCP connection is required. The mono process must be started manually with the necessary arguments.
Menu "Mono"/"Attach to mono debugger (without SSH)"
Build Startup Project with MDB Files
You can build the startup project and all dependent projects. Additionally the mdb files are created. This is necessary for the support "Attach to mono debugger (without SSH)", because the mdb files must be present in every output directory of dependent projects.
Menu "Mono"/"Build Startup Project with MDB Files"
Overwrite the remote deploy path for a startup project
- You have to enable the option via
Menu "Mono"/"Settings..."/"Search 'Deploy Path' in 'PROJECTNAME.VSMonoDebugger.config' of the startup project."
- You have to create a file with name 'PROJECTNAME.VSMonoDebugger.config' in the same directory like your startup project file (PROJECTNAME have to be the name of your project).
ex.: 'MyNewSampleProject.csproj' results in 'MyNewSampleProject.VSMonoDebugger.config'
- The file must contain a JSON object with the property "SSHDeployPath":
[ ] Support prerequisite Microsoft.VisualStudio.Component.MonoDebugger without copying the dlls (Makes problems with Xamarin's debugger)
If you are using Xamarin and debugging fails, please disable VSMonoDebugger!
[ ] Support settings in an Options Page
[ ] Code has to be refactored for better error logging
[ ] Why can't the Mono.Cecil.Pdb.NativePdbReaderProvider type be found in Visual Studio to support pdb files?
- [x] Script to stop running mono debug process has dependencies (workaround depends on installed packages)
- [x] Support break points in referenced projects. *.mdb files are searched locally in each output directory, so we need mdb files in each project output directory (see Mono.Cecil.Cil.DefaultSymbolReaderProvider.GetSymbolReader()).
- [x] Ignore unsupported project types (like C++, VB, F#)
- [x] Under Ubuntu replace the Pre-Debug script with
pkill -f mono to kill old mono debug sessions.
And give your user root rights for
mono see: Run a specific program as root without a password promt
# User alias specification
yourUserName ALL=(ALL) NOPASSWD: /usr/bin/pkill, /usr/bin/mono
- [x] Support ssh private key authentication to authenticate
- [x] When using the ProvideAutoLoad attribute, your package (VSMonoDebugger.VSMonoDebuggerPackage) class should derive from AsyncPackage instead of Package to improve performance. Read more about using AsyncPackage here: https://aka.ms/asyncpackage.
Visual Studio 2019 shows a warning
- [x] Bugfix: #11 Revert package reference update to support older version of visual studio 2017 (15.0.x)
- [x] Bugfix: Support Visual Studio 2019 16.x version numbers (before only 16.0)
- [x] Bugfix: #11 Program Output wasn't printed into output window anymore
- [x] Feature: Switched to AsyncPackage to avoid warning in Visual Studio 2019
- [x] Feature: Supports a separate deployment path for each startup project via PROJECTNAME.VSMonoDebugger.config in the project folder
- [x] Bugfix: #7 Catch exception of unsupported setup projects .vdproj
- [x] Bugfix: #10 Allow only IPv4 for the result of Dns.GetHostAddresses - IPv6 is not supported by mono softdebugger
- [x] Feature: Support Visual Studio 2019
- [x] Bugfix: Include System.Diagnostics.Tracer.dll - is not installed on some systems
- [x] Feature: Support ssh private key authentication
- [x] Bugfix: Fixed build error if solution has other project types like C++ (only CSharp projects are built)
- [x] Bugfix: Support break points in referenced projects. *.mdb files are searched locally in each output directory, so we need mdb files in each project output directory.
- [x] Feature: Build only startup project instead of whole solution and show error window automatically
- [x] Feature: Add new menu item "Attach to mono debugger (without SSH)"
- [x] Feature: Add new menu item "Build Startup Project with MDB Files"
- [x] Bugfix: NullReference in UserSettingsContainer fixed
- [x] Bugfix: Visual Studio 2017 doesn't include Newtonsoft.Json.dll anymore. See newtonsoftjsondll-not-included-in-vsix
- [x] Bugfix: Load default UserSettings without username and password instead of NullReferenceException
- [x] Feature: Support custom debug scripts. (ex. to support sudo or additional preparations.)
- [x] Feature: Error logging and handling improved for StartDebuggerAsync if a script has syntax errors.
- [x] Support fast deployment with SshDeltaCopy
- [x] Integrate the Xamarin Mono Debugger (Mono.Debugging.VisualStudio.4.9.10-pre)
- [x] Create mdb files before deployment with a integrated pdb2mdb function
- [x] Manage multiple ssh connections (deployment devices)
- [x] Show standard output in the Visual Studio Output window
- [x] Support embedded devices (Testet on a Raspberry 2 with Yocto Linux version 4.9.27 and Mono 5.4)