diff --git a/src/EchoHub.Server/Program.cs b/src/EchoHub.Server/Program.cs index 78a066f..17c7b85 100644 --- a/src/EchoHub.Server/Program.cs +++ b/src/EchoHub.Server/Program.cs @@ -202,8 +202,28 @@ while (true) } }, heartbeatCts.Token); - // ── Enumerate hosted services (DI resolution) ──────────────────── - Console.Error.WriteLine("[DIAG] Resolving IHostedService instances from DI..."); + // ── Resolve singletons one-by-one to find which one hangs ──────── + Console.Error.WriteLine("[DIAG] Resolving PresenceTracker..."); + _ = app.Services.GetRequiredService(); + Console.Error.WriteLine("[DIAG] PresenceTracker OK."); + + Console.Error.WriteLine("[DIAG] Resolving JwtTokenService..."); + _ = app.Services.GetRequiredService(); + Console.Error.WriteLine("[DIAG] JwtTokenService OK."); + + Console.Error.WriteLine("[DIAG] Resolving FileStorageService..."); + _ = app.Services.GetRequiredService(); + Console.Error.WriteLine("[DIAG] FileStorageService OK."); + + Console.Error.WriteLine("[DIAG] Resolving IChatBroadcaster..."); + _ = app.Services.GetServices().ToList(); + Console.Error.WriteLine("[DIAG] IChatBroadcaster OK."); + + Console.Error.WriteLine("[DIAG] Resolving IChatService..."); + _ = app.Services.GetRequiredService(); + Console.Error.WriteLine("[DIAG] IChatService OK."); + + Console.Error.WriteLine("[DIAG] Resolving IHostedService instances..."); var hostedServices = app.Services.GetServices().ToList(); Console.Error.WriteLine($"[DIAG] Found {hostedServices.Count} hosted services:"); foreach (var svc in hostedServices)