From 3dc20a93257ce360adba98375a9a7e499cf12a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Thu, 5 Jan 2023 14:26:47 +0100 Subject: [PATCH] Add check for application shutdown when waiting for debugger --- src/Connected.Host/ConnectedPlatformService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connected.Host/ConnectedPlatformService.cs b/src/Connected.Host/ConnectedPlatformService.cs index 3c09412..c0ff65d 100644 --- a/src/Connected.Host/ConnectedPlatformService.cs +++ b/src/Connected.Host/ConnectedPlatformService.cs @@ -18,7 +18,7 @@ internal sealed class ConnectedPlatformService : BackgroundService protected override async Task ExecuteAsync(CancellationToken stoppingToken) { if (GlobalConfig.GetValue("waitForDebugger")) - while (!Debugger.IsAttached) + while (!Debugger.IsAttached && !stoppingToken.IsCancellationRequested) await Task.Delay(500); await DependencyLoader.LoadPackages(Config.MicroServices, Config.Repositories);