diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs index 7ba222918425c..00a392a2bec07 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs @@ -305,6 +305,8 @@ internal static bool ValidServiceName(string serviceName) /// /// Disposes of the resources (other than memory ) used by /// the . + /// This is called from when all + /// services in the process have entered the SERVICE_STOPPED state. /// protected override void Dispose(bool disposing) { diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs index a22f7b967594f..a65fc54827687 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs @@ -116,6 +116,10 @@ public async Task WriteStreamAsync(PipeMessageByteCode code, int command = 0) } } + /// + /// This is called from when all services in the process + /// have entered the SERVICE_STOPPED state. It disposes the named pipe stream. + /// protected override void Dispose(bool disposing) { if (!_disposed)