Search code examples
c#linux.net-coresdkpdb-files

Pdb files fail to load when debugging C# project in dotnet 6


As the title states, I am having troubles debugging any C# project in dotnet 6. Running the project as usual works fine, but the "Debug Output" from JetBrains Rider says that some pdb files of the framework itself won't load.

I initially tried debugging with my usual IDE, JetBrains Rider, which have worked just as normal until yesterday. Although my program, an aspnet 6 app, doesn't output any errors, the "Debug Output" shows the following:

Loaded Assembly '/home/main/.dotnet/shared/Microsoft.NETCore.App/6.0.21/System.Net.Security.dll'
Loading module /home/main/.dotnet/shared/Microsoft.NETCore.App/6.0.21/System.Net.Security.dll in application domain 1:clrhost
Pdb file for assembly /home/main/.dotnet/shared/Microsoft.NETCore.App/6.0.21/System.Net.Security.dll was not found or failed to read
Loaded Assembly '/home/main/.dotnet/shared/Microsoft.NETCore.App/6.0.21/System.Security.Cryptography.X509Certificates.dll'
Loading module /home/main/.dotnet/shared/Microsoft.NETCore.App/6.0.21/System.Security.Cryptography.X509Certificates.dll in application domain 1:clrhost
Pdb file for assembly /home/main/.dotnet/shared/Microsoft.NETCore.App/6.0.21/System.Security.Cryptography.X509Certificates.dll was not found or failed to read

... and so on which continues for a few hundred lines or so.

This is the case for all projects I try to debug, including (but not limited to) completely untouched Console Apps in dotnet 6 and 7. In the project I initially tried to debug, the debug session just shut down after getting past the aspnet controller when I made a request to it.

I have tried disabling "Enable external source debug" in Rider (which seems to be the equivalent of enabling "Just my code" in VS), but this didn't have any effect whatsoever.

I then tried the "dotnet run --debug" command, which didn't display any of the "Debug Output" (that could be seen in Rider), though the program still stopped after I made a request to the api.

I got similar debug output messages to those I mentioned before in vs code, which I thought confirmed it was my dotnet installation that was broken. To reinstall it, I removed the /usr/share/dotnet and the ~/.dotnet directories. I then ran the dotnet-install.sh script twice, first with the arguments --channel 6.0 --runtime aspnetcore and then with just --channel 6.0.

After the reinstall I still get the same result as before. I scoured the internet, even turning to chat-gpt for salvation, but in the end, I'm still at square one.

Thank you for your help!

P.S: Not that it seems to matter as the error persists in dotnet 7, but the dotnet sdk version I am using is 6.0.413 and the runtime version is 6.0.21.

Edit 1: I also tried debugging a Hello world application as root, which also did not work, meaning the problem is most likely not due to insufficient permissions.


Solution

  • The debugging worked all along and the debug output error messages appears on all Linux and Mac OS devices that I tested.

    The problem was that a faulty SQL connection string (passed to ef core) caused the program to crash without error messages and without the debugger breaking execution.