A .NET Standard library for running .NET Core applications as Windows services without requiring the full .NET Framework.
DasMulli/dotnet-win32-service is a .NET Standard library that provides helper classes for running .NET Core applications as native Windows services. It solves the problem of needing the full .NET Framework or wrapper assemblies to create Windows services, enabling modern .NET Core applications to integrate directly with the Windows Service Control Manager.
Developers building .NET Core applications that need to run as Windows services, particularly those targeting Windows Nano Server or requiring cross-platform compatibility with Linux daemons.
It offers a lightweight, direct alternative to the traditional ServiceBase class, allowing developers to use the latest .NET Core features without dependencies on the full .NET Framework, and supports self-registration and pause/continue functionality.
Helper classes to set up and run as windows services directly on .net core. A ServiceBase alternative.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses P/Invoke calls into Windows APIs to run .NET Core apps as native services, eliminating dependencies on the full .NET Framework or wrapper assemblies, as demonstrated in the sample code for direct service hosting.
Allows building applications that can switch between Windows services and Linux daemons using runtime checks, enabling truly portable codebases for mixed environments.
Implements IPausableWin32Service for services that need to pause and resume operations, providing flexibility beyond basic start/stop functionality.
Includes sample applications that show how to programmatically register and unregister services, simplifying deployment with commands like `dotnet run --register-service`.
All exceptions are thrown as Win32Exception with a generic exit code -1, lacking custom error codes which complicates debugging and integration with monitoring tools.
Does not handle commands like power events or shutdown out of the box; users must implement custom state machines based on SimpleServiceStateMachine, adding complexity.
Relies on elevated command prompts and external tools like sc.exe for registration or custom code, making setup more involved compared to automated frameworks.