System.ServiceProcess.ServiceController 10.0.0-preview.6.25358.103

About

Provides the System.ServiceProcess.ServiceController API, which allows to connect to a Windows service, manipulate it, or get information about it. Not supported on other platforms.

Key Features

  • Retrieve information from Windows services
  • Connect to and manipulate Windows services (start, pause, stop or other operations)

How to Use

Retrieve Windows service information

using System.ServiceProcess;

// Loop through all installed Windows services and print the name, status and display name.
foreach (ServiceController serviceController in ServiceController.GetServices())
{
    Console.WriteLine("Name: " + serviceController.ServiceName);
    Console.WriteLine("Status: " + serviceController.Status.ToString());
    Console.WriteLine("Display name: " + serviceController.DisplayName);
}

// Loop through all installed device driver services
foreach (ServiceController serviceController in ServiceController.GetDevices())
{
    Console.WriteLine("Name: " + serviceController.ServiceName);
    Console.WriteLine("Status: " + serviceController.Status.ToString());
    Console.WriteLine("Display name: " + serviceController.DisplayName);
}

Manipulate a Windows service

using System.ServiceProcess;

ServiceController service = new("TestServiceName");
if (service.CanStop && service.Status != ServiceControllerStatus.Stopped && service.Status != ServiceControllerStatus.StopPending)
{
    service.Stop();
}

Main Types

The main types provided by this library are:

  • System.ServiceProcess.ServiceController
  • System.ServiceProcess.ServiceControllerStatus
  • System.ServiceProcess.ServiceType

Additional Documentation

Feedback & Contributing

System.ServiceProcess.ServiceController is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.ServiceProcess.ServiceController.

Packages Downloads
FlubuCore
A C# library for building projects and executing deployment scripts using C# code. Wiki can be found at: https://github.com/flubu-core/flubu.core/wiki A detailed example of how Flubu is used to build example project: https://bitbucket.org/zoroz/flubu.core.examples
2
FlubuCore
A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code. Documentation can be found at: https://github.com/dotnetcore/FlubuCore Detailed examples can be found at: https://github.com/dotnetcore/FlubuCore.Examples
2
FlubuCore
A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code. Documentation can be found at: https://github.com/dotnetcore/FlubuCore Detailed examples can be found at: https://github.com/dotnetcore/FlubuCore.Examples
4
FlubuCore
A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code. Documentation can be found at: https://github.com/flubu-core/flubu.core Detailed examples can be found at: https://github.com/flubu-core/examples
1
FlubuCore
A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code. Documentation can be found at: https://github.com/flubu-core/flubu.core Detailed examples can be found at: https://github.com/flubu-core/examples
2
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
1
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
9
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
10
Microsoft.Web.Administration
This package contains the .NET Core version of the Microsoft Web Administration assembly.
6

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.2.26159.112 0 2026/3/10
11.0.0-preview.1.26104.118 1 2026/4/10
10.0.5 1 2026/4/11
10.0.4 2 2026/4/11
10.0.3 2 2026/4/11
10.0.2 1 2026/4/11
10.0.1 1 2026/4/10
10.0.0 2 2026/4/10
10.0.0-rc.2.25502.107 0 2025/10/14
10.0.0-rc.1.25451.107 1 2026/4/12
10.0.0-preview.7.25380.108 0 2025/8/12
10.0.0-preview.6.25358.103 1 2026/4/10
10.0.0-preview.5.25277.114 0 2025/6/6
10.0.0-preview.4.25258.110 1 2026/4/10
10.0.0-preview.3.25171.5 0 2025/4/10
10.0.0-preview.2.25163.2 0 2025/3/18
10.0.0-preview.1.25080.5 1 2026/4/10
9.0.14 1 2026/4/11
9.0.13 1 2026/4/11
9.0.12 1 2026/4/11
9.0.11 1 2026/4/11
9.0.10 1 2026/4/11
9.0.9 1 2026/4/12
9.0.8 1 2026/4/12
9.0.7 0 2025/7/8
9.0.6 1 2026/4/12
9.0.5 1 2026/4/12
9.0.4 0 2025/4/8
9.0.3 0 2025/3/11
9.0.2 0 2025/2/11
9.0.1 1 2026/4/12
9.0.0 0 2024/11/12
9.0.0-rc.2.24473.5 0 2024/10/8
9.0.0-rc.1.24431.7 1 2026/4/10
9.0.0-preview.7.24405.7 0 2024/8/13
9.0.0-preview.6.24327.7 1 2026/4/12
9.0.0-preview.5.24306.7 1 2026/4/12
9.0.0-preview.4.24266.19 0 2024/5/21
9.0.0-preview.3.24172.9 1 2026/4/12
9.0.0-preview.2.24128.5 0 2024/3/12
9.0.0-preview.1.24080.9 0 2024/2/13
8.0.1 1 2026/4/12
8.0.0 3 2025/4/29
8.0.0-rc.2.23479.6 0 2023/10/10
8.0.0-rc.1.23419.4 0 2023/9/12
8.0.0-preview.7.23375.6 1 2026/4/12
8.0.0-preview.6.23329.7 1 2026/4/12
8.0.0-preview.5.23280.8 0 2023/6/13
8.0.0-preview.4.23259.5 1 2026/4/12
8.0.0-preview.3.23174.8 1 2026/4/12
8.0.0-preview.2.23128.3 0 2023/3/14
8.0.0-preview.1.23110.8 0 2023/2/21
7.0.1 0 2023/6/13
7.0.0 0 2022/11/7
7.0.0-rc.2.22472.3 0 2022/10/11
7.0.0-rc.1.22426.10 0 2022/9/14
7.0.0-preview.7.22375.6 0 2022/8/9
7.0.0-preview.6.22324.4 0 2022/7/12
7.0.0-preview.5.22301.12 0 2022/6/14
7.0.0-preview.4.22229.4 0 2022/5/10
7.0.0-preview.3.22175.4 1 2026/4/10
7.0.0-preview.2.22152.2 0 2022/3/14
7.0.0-preview.1.22076.8 0 2022/2/17
6.0.1 1 2026/4/12
6.0.0 0 2021/11/8
6.0.0-rc.2.21480.5 1 2026/4/10
6.0.0-rc.1.21451.13 0 2021/9/14
6.0.0-preview.7.21377.19 1 2026/4/10
6.0.0-preview.6.21352.12 0 2021/7/14
6.0.0-preview.5.21301.5 0 2021/6/15
6.0.0-preview.4.21253.7 0 2021/5/24
6.0.0-preview.3.21201.4 0 2021/4/8
6.0.0-preview.2.21154.6 2 2026/4/10
6.0.0-preview.1.21102.12 0 2021/2/12
5.0.0 0 2020/11/9
5.0.0-rc.2.20475.5 0 2020/10/13
5.0.0-rc.1.20451.14 1 2026/4/10
5.0.0-preview.8.20407.11 0 2020/8/25
5.0.0-preview.7.20364.11 0 2020/7/21
5.0.0-preview.6.20305.6 0 2020/6/25
5.0.0-preview.5.20278.1 0 2020/6/10
5.0.0-preview.4.20251.6 0 2020/5/18
5.0.0-preview.3.20214.6 0 2020/4/23
5.0.0-preview.2.20160.6 0 2020/4/2
5.0.0-preview.1.20120.5 0 2020/3/16
4.7.0 5 2025/4/16
4.7.0-preview3.19551.4 0 2019/11/13
4.7.0-preview2.19523.17 0 2019/11/1
4.7.0-preview1.19504.10 0 2019/10/15
4.6.0 0 2019/9/23
4.6.0-rc1.19456.4 0 2019/9/16
4.6.0-preview9.19421.4 0 2019/9/4
4.6.0-preview9.19416.11 0 2019/9/4
4.6.0-preview8.19405.3 1 2026/4/10
4.6.0-preview7.19362.9 1 2026/4/10
4.6.0-preview6.19303.8 0 2019/6/12
4.6.0-preview6.19264.9 0 2019/9/4
4.6.0-preview5.19224.8 1 2026/4/10
4.6.0-preview4.19212.13 0 2019/4/18
4.6.0-preview3.19128.7 0 2019/3/6
4.6.0-preview.19073.11 0 2019/1/29
4.6.0-preview.18571.3 0 2018/12/3
4.5.0 1 2025/4/29
4.5.0-rc1 0 2018/5/6
4.5.0-preview2-26406-04 0 2018/4/10
4.5.0-preview1-26216-02 1 2026/4/10
4.5.0-preview1-25914-04 0 2017/11/15
4.4.1 1 2026/4/12
4.4.0 1 2026/4/12
4.4.0-preview2-25405-01 0 2017/6/27
4.4.0-preview1-25305-02 1 2026/4/10
4.3.0 0 2016/11/15
4.3.0-preview1-24530-04 0 2016/10/24
4.1.0 2 2025/4/29
4.1.0-rc2-24027 1 2026/4/10
4.1.0-beta-23516 0 2015/11/18
4.1.0-beta-23409 0 2015/10/15
4.1.0-beta-23225 0 2015/9/2
4.0.0-beta-23123 0 2015/7/29
4.0.0-beta-23109 0 2015/7/27
4.0.0-beta-23019 0 2015/6/30
4.0.0-beta-22816 0 2015/4/24
4.0.0-beta-22605 0 2015/2/13
4.0.0-beta-22416 0 2015/1/16