LANCommander/LANCommander.Server/Startup/Debug.cs

22 lines
520 B
C#
Raw Permalink Normal View History

2025-03-11 21:21:16 -05:00
using System.Diagnostics;
namespace LANCommander.Server.Startup;
public static class Debug
{
public static WebApplicationBuilder WaitForDebugger(this WebApplicationBuilder builder)
{
var currentProcess = Process.GetCurrentProcess();
Console.WriteLine($"Waiting for debugger to attach... Process ID: {currentProcess.Id}");
while (!Debugger.IsAttached)
{
Thread.Sleep(100);
}
Console.WriteLine("Debugger attached.");
return builder;
}
}