-Kipling
This page describes how to remotely compile and debug C# executables running on the Beaglebone Black from a remote Windows 10 PC using the Visual Studio 2017 IDE. This page is part of a series of web pages which describe how to install C# and Mono on the Beaglebone Black and also how to configure a useful remote compilation and debugging toolchain for it.
Visual Studio has no "native" ability to perform remote debugging on anything, let alone a Mono installation running on a Debian Linux Beaglebone Black. Visual Studio is very adapable though and a free, open source, "soft debugger" called MonoRemoteDebugger is available for it. In order to use the MonoRemoteDebugger software you need to install it into Visual Studio and also download and run a debugging server on the Beaglebone Black.
The MonoRemoteDebugger is designed to provide full debugging capabilities on remote .NET executables. It will also transport the compiled binaries and the necessary debugging files over (.pdb &etc) to the Beaglebone Black. This means you do not have to set up any complicated transport mechanism to get your compiled code over to the BBB. All you need to do is edit your software on the Windows PC, compile it, and when time comes to run it, use a simple menu command to set it running (and debugging) on the Beaglebone Black.
To install the MonoRemoteDebugger software in Visual Studio use the following steps.
Those are all of the installation steps you need to perform on the PC side - the remainder of the actions take place on the Beaglebone Black.
The MonoRemoteDebugger component on the Beaglebone Black is a server. The installation is simple...
sudo
to root, that functionality is not used.
wget https://github.com/techl/MonoRemoteDebugger/releases/download/v1.3.0/MonoRemoteDebugger.Server.zip
unzip -d MonoRemoteDebugger.Server MonoRemoteDebugger.Server.zip
cd MonoRemoteDebugger.Server mono MonoRemoteDebugger.Server.exe
Those are all of the installation steps you need to perform on the Beaglebone Black. The next action is to test the installation.
In order to prove that remote debugging is operational, we will need something to debug.
Create a test Console application project in Visual Studio called HelloWorldTest
.
namespace HelloWorldTest { class MainClass { public static void Main (string[] args) { Console.WriteLine ("Hello World 1"); Console.WriteLine ("Hello World 2"); Console.WriteLine ("Hello World 3"); } } }
We have three "Hello World" lines because we are going to set a breakpoint on one and step through the remotely executing code.
Inside the Visual Studio IDE you can take all the debug actions with the remotely executing program that you can do locally. The only exception, it seems, is that you cannot set breakpoints in user created threads. Perhaps a future release will offer this functionality.
Temp
directory just below the MonoRemoteDebugger.Server.exe file itself. The items with the long names (in blue) in the image below
are directories and they will contain the binaries and the associated debugging files.
At this point you have now reached the final page in the series of web pages describing how to install Mono on the Beaglebone Black. Hopefully they have provided you with some useful advice and that you are now able to create a C# program on the Beaglebone Black and also remotely compile and debug C# executables on that platform using a nice tool chain. I wish you well - good luck.
The contents of this web page are provided "as is" without any warranty of any kind and without any claim to accuracy. Please be aware that the information provided may be out-of-date, incomplete, erroneous or simply unsuitable for your purposes. Any use you make of the information is entirely at your discretion and any consequences of that use are entirely your responsibility. All source code is provided under the terms of the MIT License.