.netmauidump

minidump control for .Net MAUI not working


I want to control the minidump size for my .Net MAUI program. According to this document: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/collect-dumps-crash#types-of-mini-dumps , I tried set DOTNET_DbgMiniDumpType in program using "Environment.SetEnvironmentVariable", or directly in command line, then create a simple crash like this:

     string? str = null;
     Console.WriteLine( str.Length ); // NullReferenceException

All tests are under win11, VS2022 17.10, sample MAUI helloworld program.

But, the dmp file created under CrashDumps folder are always 580MB+, nearly the same size. Anybody can give me some advice?


Solution

  • From the Types of mini dumps you posted in your question, I saw this,

    Only full dumps are supported by the single-file and Native AOT app models.

    So what about MAUI windows? Is it an AOT app model?

    See here ReadyToRun by Default on Windows,

    R2R is form of ahead-of-time (AOT) compilation...

    So I think in .NET8 Maui on Windows is an AOT app model. That's the reason why we are always getting full dumps for MAUI windows.

    For more info, you may refer to ReadyToRun Compilation.