Search code examples
c#.net-coredeployment

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?


Solution

  • 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