John
John

Reputation: 7049

Crash reports from Microsoft Store for .NET Maui Apps

I have a MAUI App in the Microsoft Store. It's using Blazor Hybrid, ie. most of the app is a web application running in a web view.

The store statistics tells me about "crashes" but doesn't tell me more. Help text on that page says that it's likely because I don't include symbols in the package.

I release in the debug configuration, no optimizations and I publish with

dotnet publish .\Squil.Maui -f net6.0-windows10.0.19041.0

(Side note: I can't publish in VS any longer since the newest VS update. It just says "1 failed" even though nothing in the logs indicate anything was wrong. The logs do indicate .NET 7 being involved though, which is weird as this is a .NET 6 project. This used to work until recently with somewhat different looking publish dialogs. The UI does and did include a checkbox for debug symbols, but I don't know what I need to do on the command line instead. It certainly didn't do the job back when I could publish with VS.)

The package does indeed not include any pdbs and the log complains about a missing tool:

C:\Users\jens\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\Microsoft.Build.Msix.Packaging.targets(341,
5): warning : Path to `mspdbcmf.exe` could not be found. A symbols package will not be generated.

After an hour of hunting I found the tool in the Visual Studio installation and what I need to do to make it being used: Adding this to my project file makes it being picked up:

<PropertyGroup>
  <MsPdbCmfExeFullpath>..\tools\MsPdbCmf.exe</MsPdbCmfExeFullpath>
</PropertyGroup>

(I copied the file into my project.)

The build log now says

Adding file 'Squil.Maui.pdb'.

but the msix package still doesn't contain it (so what was it added to!?).

Also, I get this message in the logs:

[Non FASTLINK] The input PDB file was not generated by the linker with /DEBUG:fastlink.

I've filed a ticket with the MAUI repo.

Any ideas anyone?

Upvotes: 2

Views: 723

Answers (1)

Alex Logvin
Alex Logvin

Reputation: 881

The symbol file for windows packaged app has a .appxsym or .msixsym extension. (They are both the same, the first one works for sure in Microsoft Partner Center). The file itself is just a zip archive with .pdb files inside.

Since the dotnet publish command fails to create it for, you can use this PowerShell script to generate the .appsym file:

Compress-Archive -Path "pathToProject/bin/Release/*windows*/*x64/*.pdb" -DestinationPath "symbols.appxsym" -CompressionLevel "NoCompression" -Force
  • It goes in bin folder (where all binaries are generated)
  • then in Release (publish configuration)
  • then in ...windows... folder (it could be net7.0-windows10.0.19041.0, net8.0-windows10.0.22621.0, etc.)
  • then in ...x64 folder (you can change it to x86, x64, arm, arm64, depending on which architecture you need. In my case i generate all architectures and .pdb files are the same)
  • then it gets all .pdb files and compresses them in symbols.appxsym file

Now you can zip this .appxsym file together with the app package/bundle to create .msixupload package for Store distibution if needed (https://learn.microsoft.com/en-us/windows/msix/package/packaging-uwp-apps#create-your-app-package-upload-file-manually).

Upvotes: 1

Related Questions