10

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?

1 Answer 1

10

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.

Sign up to request clarification or add additional context in comments.

2 Comments

It seems that the blog post has moved. A dependency not mentioned here is to have the dotnet SDK installed (runtime is apparently not enough...)
Appears things have changed again as this site says the SDK is not required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.