Compare commits
2
Commits
21addffdde
...
9b852e5c95
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b852e5c95 | ||
|
|
b9ea3f9d15 |
@@ -11,6 +11,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Common\Common.csproj" />
|
||||||
<ProjectReference Include="..\DeviceCommand\DeviceCommand.csproj" />
|
<ProjectReference Include="..\DeviceCommand\DeviceCommand.csproj" />
|
||||||
<ProjectReference Include="..\Service\Service.csproj" />
|
<ProjectReference Include="..\Service\Service.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Common;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace WebAPI
|
namespace WebAPI
|
||||||
@@ -6,6 +7,14 @@ namespace WebAPI
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
// ======= 崩溃转储:未处理异常时自动生成 MiniDump =======
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
||||||
|
{
|
||||||
|
//记录dump文件
|
||||||
|
Exception ex = e.ExceptionObject as Exception;
|
||||||
|
MiniDump.TryDump($"dumps\\Error_{DateTime.Now:yyyy-MM-dd HH-mm-ss-ms}.dmp", MiniDump.Option.WithFullMemory, ex);
|
||||||
|
};
|
||||||
|
// ======= 崩溃转储结束 =======
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
|
|||||||
Reference in New Issue
Block a user