Skip to content

Instantly share code, notes, and snippets.

@Andorbal
Created January 22, 2013 16:54
Show Gist options
  • Save Andorbal/4596230 to your computer and use it in GitHub Desktop.
Save Andorbal/4596230 to your computer and use it in GitHub Desktop.
Basic service shell for running a Windows service from the console.
using System.ServiceProcess;
namespace ServiceTest
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
Start();
}
protected override void OnStop()
{
Finish();
}
public void Start()
{
// Normal start stuff
}
public void Finish()
{
// Normal stop stuff
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment