Skip to content

jmelosegui/WindowsServiceTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Service Template

This is a simple service template to easilly install and debug a .Net Windows Service.

Goals

  1. Easy to install and Uninstall
  2. Easy to Debug.

Configure the service.

You can specify the "Service Name", "Service Display Name", and "Service Descrition". Go to the Service.cs file, find 3 constants used by the service during the install process

	//TODO: Setup more suitable names here
	private const string serviceName = "WindowsService";
	private const string serviceDisplayName = "Windows Service Template";
	private const string serviceDescription = "Windows Service Description";

Install/Uninstall

For install and uninstall after you compile the application use the following commands

Install

Assuming your exe file name is Service.exe

 	Service.exe /i

Now go to the microsoft service console (services.msc) and you will see your service installed.

serviceinstall

Uninstall

 	Service.exe /u

Usage

 	Service.exe /h

Debug

On Visual Studio, open the solution explorer, right click on the project, then click properties. In the properties window click on Debug tab and add a "/d" to the Command line arguments configuration.

debugservice

Now run the project in debug mode and you will able to debug your code.

About

Windows Service Template to easily install, uninstall, and debug a windows service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages