Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debugging - Windows PDB are not supported by .NET Core debugger - how to publish correctly?

I'm writting ASP.NET Core APP in .NET Core 2.1 on Windows and after deploying it on server after using

dotnet publish --configuration Debug -r linux-x64 I'm unable to connect via remote debugger over SSH

because:

WARNING: Could not load symbols for 'Common.dll'. '/home/dev/Common.pdb' is a Windows PDB. These are not supported by the cross-platform .NET Core debugger.

Why it does happen? and how I have to publish to be able to debug it remotely?

like image 479
Joelty Avatar asked Dec 27 '19 08:12

Joelty


People also ask

How do I enable remote debugging on my server?

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.

How do I debug PDB in Visual Studio?

In Visual Studio, open Tools > Options > Debugging > Symbols (or Debug > Options > Symbols).

Which of the below debug windows are present in Visual Studio for debugging an ASP NET application?

In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5. The debugger pauses at the breakpoints.


1 Answers

Only portable PDBs are supported around all platforms in .NET Core. You have to enable them in your csproj file

 <DebugType>portable</DebugType>

You can also check the documentation and follow some articles, like this or this explaining how to setup this kind of debugging over SSH using vsdbg

like image 121
Pavel Anikhouski Avatar answered Oct 13 '22 15:10

Pavel Anikhouski