From 343749696cc24a72978e94c78977554c2d3810fb Mon Sep 17 00:00:00 2001 From: Francesco Saltori Date: Mon, 23 Mar 2020 02:06:39 +0100 Subject: [PATCH] Add service name to TimeoutException message (#33927) --- .../System.ServiceProcess.ServiceController/src/Resources/Strings.resx | 2 +- .../src/System/ServiceProcess/ServiceController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/Resources/Strings.resx b/src/libraries/System.ServiceProcess.ServiceController/src/Resources/Strings.resx index 6028274..aa322b1 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/Resources/Strings.resx +++ b/src/libraries/System.ServiceProcess.ServiceController/src/Resources/Strings.resx @@ -91,7 +91,7 @@ Cannot stop '{0}' service on computer '{1}'. - Time out has expired and the operation has not been completed. + The operation requested for service '{0}' has not been completed within the specified time interval. ServiceController enables manipulating and accessing Windows services and it is not applicable for other operating systems. diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs index e635a9c..8096fc4 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs @@ -900,7 +900,7 @@ namespace System.ServiceProcess while (Status != desiredStatus) { if (DateTime.UtcNow - start > timeout) - throw new System.ServiceProcess.TimeoutException(SR.Timeout); + throw new System.ServiceProcess.TimeoutException(SR.Format(SR.Timeout, ServiceName)); _waitForStatusSignal.WaitOne(250); Refresh(); -- 2.7.4