System.ServiceProcess.ServiceController
10.0.3
Prefix Reserved
See the version list below for details.
dotnet add package System.ServiceProcess.ServiceController --version 10.0.3
NuGet\Install-Package System.ServiceProcess.ServiceController -Version 10.0.3
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.3" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="10.0.3" />
<PackageReference Include="System.ServiceProcess.ServiceController" />
paket add System.ServiceProcess.ServiceController --version 10.0.3
#r "nuget: System.ServiceProcess.ServiceController, 10.0.3"
#:package System.ServiceProcess.ServiceController@10.0.3
#addin nuget:?package=System.ServiceProcess.ServiceController&version=10.0.3
#tool nuget:?package=System.ServiceProcess.ServiceController&version=10.0.3
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.ServiceControllerSystem.ServiceProcess.ServiceControllerStatusSystem.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.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Diagnostics.EventLog (>= 10.0.3)
-
.NETStandard 2.0
- System.Diagnostics.EventLog (>= 10.0.3)
-
net10.0
- System.Diagnostics.EventLog (>= 10.0.3)
-
net8.0
- System.Diagnostics.EventLog (>= 10.0.3)
-
net9.0
- System.Diagnostics.EventLog (>= 10.0.3)
NuGet packages (200)
Showing the top 5 NuGet packages that depend on System.ServiceProcess.ServiceController:
| Package | Downloads |
|---|---|
|
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard. |
|
|
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services. |
|
|
Microsoft.Web.Administration
This package contains the .NET Core version of the Microsoft Web Administration assembly. |
|
|
AspNetCore.HealthChecks.System
HealthChecks.System is the system health check package. |
|
|
Microsoft.WSMan.Management
Runtime for hosting PowerShell |
GitHub repositories (91)
Showing the top 20 popular GitHub repositories that depend on System.ServiceProcess.ServiceController:
| Repository | Stars |
|---|---|
|
microsoft/PowerToys
Microsoft PowerToys is a collection of utilities that supercharge productivity and customization on Windows
|
|
|
PowerShell/PowerShell
PowerShell for every system!
|
|
|
Klocman/Bulk-Crap-Uninstaller
Remove large amounts of unwanted applications quickly.
|
|
|
netchx/netch
A simple proxy client
|
|
|
Jackett/Jackett
API Support for your favorite torrent trackers
|
|
|
duplicati/duplicati
Store securely encrypted backups in the cloud!
|
|
|
winsw/winsw
A wrapper executable that can run any executable as a Windows service, in a permissive license.
|
|
|
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
|
|
|
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
|
|
|
TechnitiumSoftware/DnsServer
Technitium DNS Server
|
|
|
stride3d/stride
Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
|
|
|
BartoszCichecki/LenovoLegionToolkit
Lightweight Lenovo Vantage and Hotkeys replacement for Lenovo Legion laptops.
|
|
|
microsoft/VFSForGit
Virtual File System for Git: Enable Git at Enterprise Scale
|
|
|
Prowlarr/Prowlarr
Prowlarr is an indexer manager/proxy built on the popular *arr .net/reactjs base stack to integrate with your various PVR apps, supporting management of both Torrent Trackers and Usenet Indexers.
|
|
|
actions/runner
The Runner for GitHub Actions :rocket:
|
|
|
immense/Remotely
A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR.
|
|
|
Lidarr/Lidarr
Looks and smells like Sonarr but made for music.
|
|
|
Xabaril/AspNetCore.Diagnostics.HealthChecks
Enterprise HealthChecks for ASP.NET Core Diagnostics Package
|
|
|
rayenghanmi/RyTuneX
RyTuneX is a cutting-edge optimizer built with the WinUI 3 framework, designed to amplify the performance of Windows devices. Crafted for both Windows 10 and 11.
|
|
|
ravendb/ravendb
ACID Document Database
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.1.26104.118 | 324 | 2/10/2026 |
| 10.0.3 | 25,802 | 2/10/2026 |
| 10.0.2 | 416,976 | 1/13/2026 |
| 10.0.1 | 509,840 | 12/9/2025 |
| 10.0.0 | 674,619 | 11/11/2025 |
| 10.0.0-rc.2.25502.107 | 23,050 | 10/14/2025 |
| 10.0.0-rc.1.25451.107 | 26,348 | 9/9/2025 |
| 10.0.0-preview.7.25380.108 | 13,204 | 8/12/2025 |
| 10.0.0-preview.6.25358.103 | 8,009 | 7/15/2025 |
| 10.0.0-preview.5.25277.114 | 6,906 | 6/6/2025 |
| 10.0.0-preview.4.25258.110 | 6,847 | 5/12/2025 |
| 9.0.13 | 6,387 | 2/10/2026 |
| 9.0.12 | 68,976 | 1/13/2026 |
| 9.0.11 | 324,650 | 11/11/2025 |
| 9.0.10 | 1,045,977 | 10/14/2025 |
| 9.0.9 | 1,038,798 | 9/9/2025 |
| 9.0.8 | 1,265,983 | 8/4/2025 |
| 9.0.7 | 788,415 | 7/8/2025 |
| 9.0.6 | 1,010,635 | 6/10/2025 |
| 9.0.5 | 842,862 | 5/13/2025 |