WinForms App C# Stack trace has no line numbers

Copper Contributor

I have a C# project built with Visual Studio 2019. In the Build options I have selected "PDB-only" for Debugging information (but tried also "Full").
When creating App Packages I check "Include public symbol files".
When the program is installed with this package and crashes, the stack trace does not include line numbers. When I copy the Release folder to the target machine and run it from there, the strack trace includes line numbers.
Looking in a forum I found
https://social.msdn.microsoft.com/Forums/en-US/5c0ab108-edf6-426c-b60b-4dc1017d9e2b/is-it-possible-t...
This thread ends with "Yes, it seems windows store does not support it.". It was posted in March 2015 and I hope since then something has changed, e.g. the option "Include public symbol files" was added. I mean: why adding public symbols, if not for the sake of a stack trace with line numbers?
I also tried to add the PDB-file by adding
<Content Include="....pdb" />
in the wapproj-file, but the PDB-file was not added, whereas a file with a different extension was added in the correct folder.
What else can I do to get line numbers in stack trace, when program is installed from MSIX-package?

7 Replies

@Nwagner2225 I'm looking into this and will let you know 

Typically getting line numbers in exception stack traces requires the runtime to be able to find the symbols for the binaries. Release builds should produce symbols. You may also be interested in embedding the symbols. See the “DebugType” property in the MSBuild documentation: https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-properties?view=vs-2022
To avoid any misunderstanding: you are talking about the setting "Debugging information" in screen "Advanced Build Settings" of Project properties, right?
I tried all the settings there. Using "Full" or "PDB only" a PDB-file is created and I get line numbers when I start the program from Release folder - but not when I start it from the installed MSIX-package. Using "Embedded" or "Portable" I even do not get line numbers when I start the program from Release folder.
According to my understanding, it is not a problem of building the program. It is a problem, that the PDB file - allthough created - does not get installed with the MSIX-package.

@Nwagner2225 basically this is by design. Store does not like packages with pdbs for policy.

per docs here https://docs.microsoft.com/en-us/windows/msix/package/packaging-uwp-apps

Symbols for appx package are compressed as .appxsym(as part of .appxupload) and will only be used in Partner center for crash analysis

 

@ Aditi_Narvekar thanks for this information.
Currently I am using Microsoft AppCenter for crash reporting - and there I do not get the line numbers. In Partner center I see that there was a crash, but without any details, just "Unknown". If I remove AppCenter, will I get more details in Partner center? In general I like AppCenter, because it helps tracking the errors. But if I can get line numbers in Partner center ...
I don't believe that will help. But maybe you can try it
I tried it now: it did not help. After removing AppCenter there is still nothing more than "Unknown" in Partner center.