How do I attach the Visual Studio debugger to an ASP.NET Core application running on an Ubuntu server?
I really need to step through my code on the server to see what is going on. Is that possible yet?
When Microsoft launched their . Net Core framework the key selling point was it is a cross-platform framework, which mean't that now we can host our . Net application not only on Windows but on Linux too, so let's see how we can deploy .
Set up the remote debugger on Windows ServerOn the remote computer, find and start the Remote Debugger from the Start menu. If you don't have administrative permissions on the remote computer, right-click the Remote Debugger app and select Run as administrator. Otherwise, just start it normally.
This blog post from Microsoft shows that this is certainly possible. You will be debugging the process over SSH.
You will need minimum the 1/27/2017 update (RC3) for Visual Studio 2017 RC. Also, you need to install a few utilities like openssh-server
, unzip
and curl
on your server.
Then you can deploy a debug release to the your Ubuntu server. The Linux debugger needs Portable PDBs to be enabled (which is the default).
Attach the debugger and select SSH as the connection type.
Change Connection Target to the IP address of the Ubuntu server.
Select the required process (dotnet) to debug and click "Attach".
You will get a dialog to select which type of code you would like to debug. Pick Managed (.NET Core for Unix).
It should enable you to start debugging the ASP.NET Core app deployed on Ubuntu.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With