Compare commits

...
2 Commits
Author SHA1 Message Date
“hsc” 9b852e5c95 解决冲突 2026-08-21 16:39:49 +08:00
“hsc” b9ea3f9d15 IOT纯后端项目改造 2026-08-21 16:38:18 +08:00
3 changed files with 10 additions and 0 deletions
View File
+1
View File
@@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\DeviceCommand\DeviceCommand.csproj" />
<ProjectReference Include="..\Service\Service.csproj" />
</ItemGroup>
+9
View File
@@ -1,3 +1,4 @@
using Common;
using System.Text.Json;
namespace WebAPI
@@ -6,6 +7,14 @@ namespace WebAPI
{
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);
// Add services to the container.