maui
maui copied to clipboard
Default VS symbol loading mechanism does not work
Description
pdbs should be published in a way which is easily consumable with VS default Symbol server, respective with SourceLink.
Currently it's not easy/obvious to comsune the pdbs.

Steps to Reproduce
- create a maui app via VS 17.4 Preview 3
- update target-framework to net7 in csproj
- enable default symbol servers
- uncheck "just my code"
- start maui app
- open modules window
- select microsoft.maui.controls.dll
- rightclick -> "load symbols"
Expected Result: symbols are loaded (from nuget or symbol server)
Actual Result: no symbols can be loaded, because none are found
Link to public reproduction project repository
n/a
Version with bug
assembly-version: 7.00.0.269
Last version that worked well
i think, it never worked in maui.
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
assembly-version: 7.00.0.269
Did you find any workaround?
manually select the pdb from C:\Program Files\dotnet\packs\Microsoft.Maui.Controls.Runtime.win\7.0.0-rc.1.6683\lib\net7.0-windows10.0.19041
Relevant log output
C:\Users\juwens\source\repos\MauiAppValueTypeConversionExample\MauiAppMassConversionExample\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\juwens\source\repos\MauiAppValueTypeConversionExample\MauiAppMassConversionExample\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
D:\a\_work\1\s\src\Controls\src\Core\obj\Release\net7.0-windows10.0.19041\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\c6f2c1b347ce4b3183e4848f501c9a2cffffffff\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\juwens\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\Microsoft.Maui.Controls.pdb\c6f2c1b347ce4b3183e4848f501c9a2cffffffff\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\c6f2c1b347ce4b3183e4848f501c9a2c1\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\juwens\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\Microsoft.Maui.Controls.pdb\c6f2c1b347ce4b3183e4848f501c9a2c1\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
SYMSRV: BYINDEX: 0x29
C:\Users\juwens\AppData\Local\Temp\SymbolCache*https://referencesource.microsoft.com/symbols
Microsoft.Maui.Controls.pdb
C6F2C1B347CE4B3183E4848F501C9A2Cffffffff
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2Cffffffff\Microsoft.Maui.Controls.pdb - path not found
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2Cffffffff\Microsoft.Maui.Controls.pd_ - path not found
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2Cffffffff\file.ptr - path not found
SYMSRV: HTTPGET: /symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2Cffffffff/Microsoft.Maui.Controls.pdb
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: HTTPGET: /symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2Cffffffff/Microsoft.Maui.Controls.pd_
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: HTTPGET: /symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2Cffffffff/file.ptr
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: RESULT: 0x80190194
SYMSRV: BYINDEX: 0x2A
C:\Users\juwens\AppData\Local\Temp\SymbolCache*https://referencesource.microsoft.com/symbols
Microsoft.Maui.Controls.pdb
C6F2C1B347CE4B3183E4848F501C9A2C1
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2C1\Microsoft.Maui.Controls.pdb - file not found
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2C1\Microsoft.Maui.Controls.pd_ - file not found
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2C1\file.ptr - file not found
SYMSRV: HTTPGET: /symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2C1/Microsoft.Maui.Controls.pdb
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: HTTPGET: /symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2C1/Microsoft.Maui.Controls.pd_
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: HTTPGET: /symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2C1/file.ptr
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: RESULT: 0x80190194
https://referencesource.microsoft.com/symbols: Symbols not found on symbol server.
https://msdl.microsoft.com/download/symbols: Skipped checking location. A stripped symbol file was previously found in this location.
SYMSRV: BYINDEX: 0x2B
C:\Users\juwens\AppData\Local\Temp\SymbolCache*https://symbols.nuget.org/download/symbols
Microsoft.Maui.Controls.pdb
C6F2C1B347CE4B3183E4848F501C9A2Cffffffff
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2Cffffffff\Microsoft.Maui.Controls.pdb - path not found
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2Cffffffff\Microsoft.Maui.Controls.pd_ - path not found
SYMSRV: UNC: C:\Users\juwens\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\C6F2C1B347CE4B3183E4848F501C9A2Cffffffff\file.ptr - path not found
SYMSRV: HTTPGET: /download/symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2Cffffffff/Microsoft.Maui.Controls.pdb
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: HTTPGET: /download/symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2Cffffffff/Microsoft.Maui.Controls.pd_
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: HTTPGET: /download/symbols/Microsoft.Maui.Controls.pdb/C6F2C1B347CE4B3183E4848F501C9A2Cffffffff/file.ptr
SYMSRV: HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV: RESULT: 0x80190194
https://symbols.nuget.org/download/symbols: Symbols not found on symbol server.
I don't see, how you are supposed to consume the pdb's from #2317
Thanks for the issue report @juwens! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.
If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
- Go to the VS feedback tool to report the issue
- Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.
This issue will be automatically closed in 3 days if there are no further comments.
Only MAUI is affected. other symbol loading from symbol-servers/sourcelink work fine. I don’t see, how this is a VS fault.
Did you try it out?
Did you look at the symbol loading output, and see a clue why it’s VS‘s fault?
Are you sure that MAUI publishes it’s symbol packages in the VS expected way, as many other projects do?
This issue is being closed due to inactivity. If this issue is still affecting you, please follow the steps above to use the VS Feedback Tool to report the issue.
What the heck?
@PureWeen This is not a VS issue, the MAUI symbols are not published to Nuget, making it very hard to debug when MAUI itself throws an error.
@juwens the PDBs are included within the nuget package itself. If you go to your nuget cache you should be able to find them for all the MAUI packages and can load them manually. I do agree that they should be published to nuget itself as well though, since that would be more accessible for everyone.
I think it might still be a tooling issue? Probably, maybe the loading of all this is different because it's a workload and not an actual NuGet?
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I tried loading MAUI symbols for my app and found it very frustrating. Out-of-the-box, VisualStudio cannot find any symbols. The "Modules" window fails to show which version of the DLL is actually in use:
I searched my "workloads" folder and found over 50 potential matches -- none of them actually matched though, wasting my time.
Next, I search my nuget cache -- found a few candidates, debugger wouldn't load any of them.
Next, I found more PDBs in my intermediate-output folder. Great, I thought, this must be it. Nope, VisualStudio again reports a mismatch.
So, having wasted 30 minutes of my time, I give up. I wanted to contribute to MAUI by debugging a problem and writing a helpful bug report but I can't.
@mstefarov thanks for commenting, always good to know that i'm not the only advanced MAUI user. And others have the same issues like me 😀
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on with .NET MAUI Template project using default VS symbol.
Note: If add "http://symweb/" symbol, it will loaded Symbols fine.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on with .NET MAUI Template project using default VS symbol.
Note: If add "http://symweb/" symbol, it will loaded Symbols fine.
Can you please link documentation for this symbol server or explain.
I googled for it and there were no infos about it.
The pdb's do ship inside the nugets, and if you look at symbol load information in VS you might see something like:
X:\tempcode\MauiApp8\MauiApp8\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
X:\tempcode\MauiApp8\MauiApp8\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
D:\a\_work\1\s\src\Controls\src\Core\obj\Release\net8.0-windows10.0.19041\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\user\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\3eae086deb4a43bc80f0a7375723c84bffffffff\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\user\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\Microsoft.Maui.Controls.pdb\3eae086deb4a43bc80f0a7375723c84bffffffff\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\user\AppData\Local\Temp\SymbolCache\Microsoft.Maui.Controls.pdb\3eae086deb4a43bc80f0a7375723c84b1\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
C:\Users\user\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\Microsoft.Maui.Controls.pdb\3eae086deb4a43bc80f0a7375723c84b1\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
X:\tempcode\MauiApp8\Microsoft.Maui.Controls.pdb: Cannot find or open the PDB file.
From what I can tell, the problem might be that the paths aren't normalized and so it can't find the pdb's that sit alongside the exe.
There's some docs on the ContinuousIntegrationBuild property which suggest that setting this property causes the paths to be normalized in the debug symbols. I tried setting some of these properties: https://github.com/dotnet/maui/pull/16127
However I'm still seeing nuget complain about determinstic not being set:
I spent some time investigating this today, including creating a simple test nuget package. Here are my findings:
First, on the package being nondeterministic:
- For my test package, setting
ContinuousIntegrationBuildto true was not sufficient to make it deterministic. That was due to this bug: https://github.com/dotnet/sdk/issues/16325. After applying this https://github.com/dotnet/docs/issues/33691 workaround, adding sourcelink, and settingEmbedUntrackedSourcesto true in the csproj, the package was then reported as deterministic by NuGet Package explorer.
Some of the above may explain why MAUI packages aren't being detected as deterministic (I need to investigate that more since we ideally should fix that too). However, it was sufficient for me to test if embedded symbols work once the package is deterministic. And they don't. Here are details of that:
- For my test package, I set
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>per doc, to include the PDBs in the nuget package. And that works - they are included after doing the dotnet pack. - I then tested consuming the package in VS and loading symbols (with WinUI). It can't find them. The cause looks to be this: https://github.com/dotnet/sourcelink/issues/628, where this is broken. .NET7 added, via https://github.com/dotnet/sdk/pull/27580, the
CopyDebugSymbolFilesFromPackagesoption to help address this. But there are two issues with relying on that: (1) it's off by default, unless the consuming app opts in by settingCopyDebugSymbolFilesFromPackagesand (2) even when enabled, it works for WPF apps but for WinUI the PDBs are copied to the output directory but not to the AppX directory so they still aren't found.
Recommendation:
- We should publish a separate symbol package, like most nuget packages do (it's the recommended approach and the happy path that works).
Workaround:
- Until we fix as above, one workaround is to set
<CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>in your csproj. With that, PDBs will be in the output directory. For WinUI you'll need to then copy the PDBs the AppX directory (e.g. copy frombin\Debug\net8.0-windows10.0.19041.0\win10-x64tobin\Debug\net8.0-windows10.0.19041.0\win10-x64\AppX. Then the debugger can find the PDBs.
@BretJohnson thanks a lot for the deep analysis. I will try the workaround next week, looks promising.
(My current workaround was to unpack all nugets into a specific location, and add this folder as a symbol source in VS). Your workaround looks better, cause I don’t need to change anything with a Maui update :)