Environment.Exit() does not create crash dump

48 Views Asked by At

I configured automatic crashdump in the aspnetcore program. Since the program runs in the container, the container will be killed directly when the oom occurs, and there is no chance to trigger the dump at all, so I wrote a BackgroundService that regularly obtains the memory usage. When using When the rate exceeds 95%, the process is terminated by the Environment.Exit() method, but I found that the dump file will not be generated. I want to know if there is any way to use the code to terminate the process and trigger the crash dump

0

There are 0 best solutions below