Chapter 11. “Off-Road” Debugging
When I first heard about debugging .NET on Linux from Visual Studio, I was both excited about the idea and curious about how it was done. What I didn’t wonder about at the time was what it was called. It wasn’t too long, however, before I heard it called “off-road debugging” and fell in love with the term.
After all, this is certainly “off the beaten path” when it comes to debugging. At the time of writing (August 2016), this is most definitely not a point-and-click procedure. In fact, there are five steps to get started—although after the initial setup, it’s rather simple and fast for future debugging. Once a VM is configured to allow off-road debugging, adding this feature to a project is one step to configure and one command to launch.
I have no insight, but I wouldn’t be surprised if this isn’t folded into a future release of .NET tooling.
Associated source code
The source code can be found in the /NetOnLinuxBook/HelloMvcApi/ directory.
Installation and Configuration
Because this feature is not built into the current .NET tooling, we’ll need to install and configure it. It takes six steps, but the first four steps are done only once per VM; the final two steps are done once for each project. This way, once you’ve set things up, it just takes a quick configuration in your project and you’re ready to debug from inside Visual Studio.
Step 1: Enable Visual Studio on Windows
You need Visual Studio 2015 Update 2 or newer to enable debugging. ...