Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ChrisPulman/ServiceInstaller

Open more actions menu

Repository files navigation

ServiceInstaller

A Library to handle installation of .net applications as services

Usage

Installation

Install the package from nuget Install-Package ServiceInstaller

Usage

using ServiceInstaller;

// Check if the args include a command
var hasCmd = args.Length > 0? args[0].Count(ch => ch == '-') : 0;
switch (hasCmd)
{
    case 1:
        // Handle service request
        Console.WriteLine(ServiceController.HandleRequest(args[0], "YourServiceName", "Display Name Of Your Service"));
        break;
    default:
        {
            // Run normally
            // Your code here
            break;
        }
}

About

A Library to handle installation of windows services

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.