Skip to content

Add generate crash report flag to WriteDump/WriteDumpAsync #2698

Closed

Description

@mikem8361

Background and Motivation

The VS for Mac team needs a way to generate the crash report json file for hangs.

Proposed Feature

Add a flags argument to the Microsoft.Diagnostics.NETCore.Client.WriteDump/WriteDumpAsync API that enables crash report json and other logging options (verbose and log to file). This will require work on the runtime side also.

Activity

  1. added this to the 6.0.0 milestone on Oct 22, 2021
  2. self-assigned this
    on Oct 22, 2021
  3. AraHaan commented on Oct 27, 2021

    @AraHaan
    Member

    You mean you want to have it be able to generate a log file that holds the stack trace?

    I actually have a library that uses the WriteDump function (with an attribute) that creates the dump and writes said log file when the UnhandledException event is triggered. Perhaps when I get the chance I could propose that to dotnet/runtime and users could just use that library instead (which has a simpler setup as it would be as simple as the following:

    [assembly: MiniDump(Text = "Text that gets used when a crash happens.", DumpType = MiniDumpType.Full)]

    or

    [MiniDump(Text = "Text that gets used when a crash happens.", DumpType = MiniDumpType.Full)]
    class Program
    {
        // snip.
    }

    or

    class Program
    {
        [MiniDump(Text = "Text that gets used when a crash happens.", DumpType = MiniDumpType.Full)]
        internal static void Main(string[] args)
        {
            // snip.
        }
    }

    And then they can setup the event that will control where the message gets printed set by the Text, and ExceptionTitle properties. Valid places can be: console, a GUI messagebox, anywhere.

    When I created this setup it simplified how I went about creating crash dumps to any program that I make and in terms where that setup was usable cross platform without any need to check what the operating system was underneath.

    Although I do admit it would be nice if it was possible to configure what files are to be included into the crash report, and where it needs to travel to directly go to the developer of the program (if they do not want it to be sent to Microsoft).

  4. ghost locked as resolved and limited conversation to collaborators on Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions