Support full Windows PDB format for .NET
From: https://github.com/getsentry/team-ingest/issues/490
We have symbolication for the .NET Portable PDB format, and for the Windows PDB format with native code, but not for the Windows PDB format as used by .NET.
It would be useful to support this, so that we can symbolicate .NET Windows apps and libraries that are compiled using this debug format when symbols are not available client-side.
See https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/code-generation#debugtype
Debug types full or pdbonly when compiled on Windows will generate a Windows PDB, not a Portable PDB. (The pdbonly option creates a variation which is more optimized for release builds, so both should be supported if possible.)
This applies both to .NET Framework and to .NET Core (and modern ".NET").
--
See attached zip containing two console app projects. One is .NET 6 and the other is .NET Framework 4.8.
~FullPDBProjects.zip~ file is lost, we'll find a replacement
In both projects, the Debug build was compiled with DebugType=full and the Release build was compiled with DebugType=pdbonly. (These are the default settings for .NET Framework out of the box.)
All .pdb files here are Windows format PDBs, not portable PDBs.
Also note that .NET 6 compiles a .dll containing the application code and a .exe "wrapper" program with the entrypoint. This is the new way since .NET Core 1.0. But .NET Framework compiles a single .exe containing all code and the entrypoint in a single file.
@jamescrosswell could you help with a sample build on Windows? The attached sample was lost due to the repo being deleted.
We should be able to get those Windows PDBs by building a .NET Console app on a Windows machine. It should be generating Windows PDBs as opposed to on Mac and Linux where it uses Portable PDBs.
Apologies for the delay... see zip attached. Includes the source as well as:
- Windows PDB:
pdb/full/ConsoleApp.pdb - Portable PDB:
pdb/pdbonly/ConsoleApp.pdb
Thank you very much!
@bruno-garcia I'm completely new to .NET, but reading the official documentation it seems like Windows PDB for .NET is deprecated:
Using Windows PDBs for managed code is obsolete and is only needed for legacy tools. It is recommended that you use portable PDBs instead of Windows PDBs, as some newer compiler features are implemented only for portable PDBs.
To use portable PDBs on tools that do not support them, you can use Pdb2Pdb, which converts between portable PDBs and Windows PDBs.
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/symbols
Do we want to invest into Windows PDB for .NET nonetheless?
The default PDB format depends on the target framework: • .NET Framework (e.g., net48, net472, etc.) • Default: Windows PDB (full) • This is the traditional Windows-only PDB format. • .NET Core (2.x, 3.x) and .NET (5, 6, 7, 8+) • Default: Portable PDB • This format is cross-platform and works on Windows, Linux, and macOS.
How to Check Your Project’s Debug Type 1. Open the .csproj file and look for:
<DebugType>...</DebugType>
• If missing, the default is applied based on the framework.
• If set to portable, you’re using Portable PDB.
• If set to full or pdbonly, you’re using Windows PDB.
2. In Visual Studio:
• Right-click the project → Properties.
• Go to Build → Advanced.
• Check Debugging Information (it will show “Portable” or “Full” PDB).
Do we want to invest into Windows PDB for .NET nonetheless?
We could try to solve this with docs. Educating users to change the pdb format of their apps. We recently did this with a large gaming customer that had all their tools on dotnet framework which by default uses Windows PDB. But there's some friction and some folks might just try and give up when they see things don't work.
So if the cost of adding support is low, I'd say it could be worth adding. Otherwise we can close this.