dotnet / dotnet/diagnostics

[Feature Request] Add flag to WriteDump Apis to hide the entire console.

Open
#2,736 0 comments 0 reactions 0 assignees View on GitHub
enhancement Microsoft.Diagnostics.NETCore.Client
Dominant language
C++
Stars
1.3k
Forks
404
Avg merge
2d 3h
Merged PRs (30d)
38

Description

## Background and Motivation

I have a program that calls into the WriteDump apis (A Windows Forms application). It used to call into MiniDumpWriteDump directly but the client package fixed where it would 100% of the time return the win32 error code ``ERROR_PARTIAL_COPY``. As such that was the motivation to move it to the client package to remove that error code rate entirely. However it is intrusive if the end user of my programs sees a console that says where the dump was generated at, when the program I made should tell them before it exits using the MessageBox apis.

## Proposed Feature

I would like an additional parameter to be added to the functions (``bool showDumpConsole``) but could be made into an optional parameter by adding ``= true`` to it to default it to true.

## Usage Examples

```cs
var diagnosticsClient = new DiagnosticsClient(SettingsFile.ThisProcessId);
try
{
diagnosticsClient.WriteDump((DumpType)MiniDumpAttribute.CurrentInstance.DumpType, MiniDumpAttribute.CurrentInstance.DumpFileName, showDumpConsole: false);
// trigger an event saying where the dump is located at.
}
catch (ServerErrorException ex)
{
// trigger an event saying the dump failed.
}
```

I use code like this in 1 of my libraries, of which myself and others use it as well.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.