Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

RobThree/DebuggableSelfInstallingOwinService

Repository files navigation

Debuggable, Self-Installing, Self-Hosted OWin Windows Service

A Debuggable, Self-Installing, Self-Hosted OWin Windows Service Template based on James Michael Hare's excellent blogposts:

How to use

  • Download the Visual Studio template
  • Create a new project and select / search for DebuggableOwinService (see screenshot below)
  • Restore the required NuGet packages (a README will be shown with (short) instructions)
  • Implement any of the provided OnStart(), OnStop(), OnPause(), OnContinue(), OnShutDown() and OnCustomCommand() methods
  • Modify the App.Config for the correct hostname/port information
  • Run/debug your application as usual, continue your development cycle as always
  • When your application is done, open a console (with Administrative privileges!) and execute MyApp.exe -installto install your service; now you can start/stop/pause your service. To uninstall your service simply run MyApp.exe -uninstall.

Screenshot of project template selector

More

The WindowsService.cs file contains the ServiceImplementation class which, as it's name suggests, implements all service methods. This class has been fitted with an WindowsServiceAttribute which you can use to control some service-specific properties like Name, DisplayName, Description, UserName, Password, EventLogSource, StartMode, CanPauseAndContinue, CanShutdown, CanStop and services your service depends on via ServiceDependsOn.

But I want more!

Sure! No problem. I can recommend the excellent Topshelf project, also available as NuGet package. This allows for even more control, has way better documentation and is also available on GitHub!

Project status

Works (tested) with:

  • Visual Studio 2013
  • Visual Studio 2015
  • Visual Studio 2017
  • Visual Studio 2019

Project status

About

A Self-hosted OWIN Windows Service project template that is easier to run and debug than the default Windows Service project template

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages