System.ServiceProcess.ServiceController 9.0.0-rc.2.24473.5
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 |
---|---|
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
|
11 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/c75b3f7a2fb9fe21fd96c93c070fdfa88a2fbe97
|
7 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3f1acb59718cadf111a0a796681e3d3509bb3381
|
6 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/57512b49997283599b00a6b67d0ccebaec171daf
|
6 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/6a01dd1e69c8b9bd1ae005ea465ef2bcd26294bf
|
6 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/827b96040e62e5aa47d829bfa61c000d315d4f2e
|
7 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/c2a442982e736e17ae6bcadbfd8ccba278ee1be6
|
6 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/c70204ae3c91d2b48fa6d9b92b62265f368421b4
|
7 |
Microsoft.AspNetCore.Hosting.WindowsServices
ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e1ad9117a4dac3b0f5f2a7e2b10b43b7016379b9
|
6 |
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
|
6 |
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
|
7 |
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
|
9 |
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.
|
6 |
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 Core as well as .NET Standard.
|
6 |
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 Core as well as .NET Standard.
|
7 |
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 Core as well as .NET Standard.
When using NuGet 3.x this package requires at least version 3.4.
|
6 |
TopShelf.ServiceInstaller
Topshelf is an open source project for hosting services without friction. By referencing Topshelf, your console application *becomes* a service installer with a comprehensive set of command-line options for installing, configuring, and running your application as a service.
|
7 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- System.Diagnostics.EventLog (>= 9.0.0-rc.2.24473.5)
.NET 8.0
- System.Diagnostics.EventLog (>= 9.0.0-rc.2.24473.5)
.NET 9.0
- System.Diagnostics.EventLog (>= 9.0.0-rc.2.24473.5)
.NET Standard 2.0
- System.Diagnostics.EventLog (>= 9.0.0-rc.2.24473.5)