diff --git a/SoraV2Utils_Agent/ServiceIPC.cs b/SoraV2Utils_Agent/ServiceIPC.cs index 8b393bd..8760ca5 100644 --- a/SoraV2Utils_Agent/ServiceIPC.cs +++ b/SoraV2Utils_Agent/ServiceIPC.cs @@ -76,12 +76,19 @@ namespace SoraV2Utils_Agent public void Exit() { - var client = new Client("SoraV2UtilsDeviceData"); - var service = client.GetServiceProxy(); - service.Exit(); + // Stop the Service + try + { + var client = new Client("SoraV2UtilsDeviceData"); + var service = client.GetServiceProxy(); + service.Exit(); + } + catch (TimeoutException) + { + } - // Exit the application gracefully - Environment.Exit(0); + // Exit the application + System.Environment.Exit(1); } } }