Is there any point including PDBs when using NativeAOT publishing? #126593
-
|
One of the options I get when creating an appx package is to including debugging symbols - do these symbols even work if I am publishing a NativeAOT project? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
The big PDB file from the native compilation is useful if you want to debug the app or diagnose crash dumps. It's a native PDB - the debugger will not know it's debugging a C# app. You'll get similar experience to debugging C++ (line numbers, breakpoints, and locals will show up, but managed concepts like properties or visualizers will not work). So yes, it's useful, but make sure you select the Native debug engine (not the managed or mixed-mode debug engine). |
Beta Was this translation helpful? Give feedback.
-
|
Yes, but their usefulness is a bit different compared to normal .NET apps. When you publish with NativeAOT, your app is compiled into native machine code, so debugging behaves more like C++ than C#. What PDBs are useful for: What you won’t get: NativeAOT removes the usual .NET runtime layer, so the debugger only sees native code, not high-level C# constructs. The takeaway is that, PDBs are still useful with NativeAOT. Just think of them as tools for low-level debugging, not full .NET debugging |
Beta Was this translation helpful? Give feedback.
The big PDB file from the native compilation is useful if you want to debug the app or diagnose crash dumps. It's a native PDB - the debugger will not know it's debugging a C# app. You'll get similar experience to debugging C++ (line numbers, breakpoints, and locals will show up, but managed concepts like properties or visualizers will not work). So yes, it's useful, but make sure you select the Native debug engine (not the managed or mixed-mode debug engine).