SlideShare a Scribd company logo
TOPSHELF - AN EASY SERVICE
HOSTING FRAMEWORK FOR BUILDING
WINDOWS SERVICES USING .NET
Larry Nung
AGENDA
Introduction
Getting started
Custom Service
Command-Line
Reference
Q & A
2
INTRODUCTION
3
INTRODUCTION
 Put Your Apps on the Topshelf
 An easy service hosting framework for building
Windows services using .NET
4
GETTING STARTED
5
GETTING STARTED
6
GETTING STARTED
7
GETTING STARTED
using System;
using Topshelf;
…
class Program {
static void Main(string[] args) {
HostFactory.Run(x => {
x.Service<Program>(s => {
s.ConstructUsing(name => new Program());
s.WhenStarted(p => p.Start());
s.WhenStopped(p => p.Stop());
});
});
}
public void Start() {
Console.WriteLine("Service start...");
}
public void Stop() {
Console.WriteLine("Service stop...");
}
}
8
GETTING STARTED
9
CUSTOM SERVICE
10
CUSTOM SERVICE
using System;
using Topshelf;
...
class Program {
static void Main(string[] args) {
HostFactory.Run(x => {
x.Service<ProgramService>();
});
}
}
class ProgramService : ServiceControl {
public bool Start(HostControl hostControl) {
Console.WriteLine("Service start...");
return true;
}
public bool Stop(HostControl hostControl) {
Console.WriteLine("Service stop...");
return true;
}
}
...
11
COMMAND-LINE
12
COMMAND-LINE
service.exe [verb] [-option:value] [-switch]
run Runs the service from the command line (default)
help, --help Displays help
install Installs the service
--autostart The service should start automatically (default)
--disabled The service should be set to disabled
--manual The service should be started manually
--delayed The service should start automatically (delayed)
-instance An instance name if registering the service
multiple times
-username The username to run the service
-password The password for the specified username
--localsystem Run the service with the local system account
--localservice Run the service with the local service account
--networkservice Run the service with the network service permission
--interactive The service will prompt the user at installation for
the service credentials 13
COMMAND-LINE
start Start the service after it has been installed
--sudo Prompts for UAC if running on Vista/W7/2008
-servicename The name that the service should use when
installing
-description The service description the service should use when
installing
-displayname The display name the the service should use when
installing
start Starts the service if it is not already running
stop Stops the service if it is running
uninstall Uninstalls the service
-instance An instance name if registering the service
multiple times
--sudo Prompts for UAC if running on Vista/W7/2008 14
COMMAND-LINE
Examples:
service install
Installs the service into the service control manager
service install -username:joe -password:bob --autostart
Installs the service using the specified username/password and
configures the service to start automatically at machine startup
service uninstall
Uninstalls the service
service install -instance:001
Installs the service, appending the instance name to the service name
so that the service can be installed multiple times. You may need to
tweak the log4net.config to make this play nicely with the log files. 15
COMMAND-LINE
16
COMMAND-LINE
17
COMMAND-LINE
18
COMMAND-LINE
19
COMMAND-LINE
20
COMMAND-LINE
21
REFERENCE
22
REFERENCE
 Topshelf
 http://topshelf-project.com/
 Welcome to Topshelf’s documentation! — Topshelf
3.0 documentation
 https://topshelf.readthedocs.io/en/latest/index.html
 Topshelf/Topshelf: An easy service hosting
framework for building Windows services
using .NET
 https://github.com/Topshelf/Topshelf
23
Q&A
24
QUESTION & ANSWER
25

More Related Content

What's hot

What's hot (17)

Easy install
Easy installEasy install
Easy install
 
Mikrotik and easy hotspot, as hotspot billing system
Mikrotik and easy hotspot, as hotspot billing systemMikrotik and easy hotspot, as hotspot billing system
Mikrotik and easy hotspot, as hotspot billing system
 
Como instalar aeroo en open erp 6
Como instalar aeroo en open erp 6Como instalar aeroo en open erp 6
Como instalar aeroo en open erp 6
 
instaling
instalinginstaling
instaling
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
 
Deploy agent in em12c
Deploy agent in em12cDeploy agent in em12c
Deploy agent in em12c
 
A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for Orangescrum
 
Definitive guide to setting up a lamp server using open source software
Definitive guide to setting up a lamp server using open source softwareDefinitive guide to setting up a lamp server using open source software
Definitive guide to setting up a lamp server using open source software
 
Firewalld LAB
Firewalld LABFirewalld LAB
Firewalld LAB
 
Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovue
 
Instalar ebs 12 2 8
Instalar ebs 12 2 8Instalar ebs 12 2 8
Instalar ebs 12 2 8
 
Powershell direct
Powershell directPowershell direct
Powershell direct
 
Ftp configuration in rhel7
Ftp configuration in rhel7Ftp configuration in rhel7
Ftp configuration in rhel7
 
Oracle ODI & Oracle SOA installation
Oracle ODI & Oracle SOA  installationOracle ODI & Oracle SOA  installation
Oracle ODI & Oracle SOA installation
 
CentOS Server Gui Initial Configuration
CentOS Server Gui Initial ConfigurationCentOS Server Gui Initial Configuration
CentOS Server Gui Initial Configuration
 
Ajenti control panel
Ajenti control panel Ajenti control panel
Ajenti control panel
 

Viewers also liked

Introductions
IntroductionsIntroductions
Introductions
jenwb
 
Ornithology_Leaflet_Highres
Ornithology_Leaflet_HighresOrnithology_Leaflet_Highres
Ornithology_Leaflet_Highres
Matthew Hopkins
 

Viewers also liked (20)

Web deploy command line
Web deploy command lineWeb deploy command line
Web deploy command line
 
C# 6.0
C# 6.0C# 6.0
C# 6.0
 
Architecture in .net
Architecture in .netArchitecture in .net
Architecture in .net
 
Developing Microsoft .NET Applications for Windows
Developing Microsoft .NET Applications for Windows Developing Microsoft .NET Applications for Windows
Developing Microsoft .NET Applications for Windows
 
Kampot
KampotKampot
Kampot
 
Tahir
TahirTahir
Tahir
 
Virus y antivirus.
Virus y antivirus.Virus y antivirus.
Virus y antivirus.
 
Discoveries 2016 Mining Conference
Discoveries 2016 Mining ConferenceDiscoveries 2016 Mining Conference
Discoveries 2016 Mining Conference
 
Introductions
IntroductionsIntroductions
Introductions
 
Ple 2016
Ple 2016Ple 2016
Ple 2016
 
Ender’s Game Presentation
Ender’s Game PresentationEnder’s Game Presentation
Ender’s Game Presentation
 
Ornithology_Leaflet_Highres
Ornithology_Leaflet_HighresOrnithology_Leaflet_Highres
Ornithology_Leaflet_Highres
 
Exposicion de la kinesiologia de la cara
Exposicion de la kinesiologia de la caraExposicion de la kinesiologia de la cara
Exposicion de la kinesiologia de la cara
 
PL/SQL Coding Guidelines - Part 2
PL/SQL Coding Guidelines - Part 2PL/SQL Coding Guidelines - Part 2
PL/SQL Coding Guidelines - Part 2
 
Common.logging
Common.loggingCommon.logging
Common.logging
 
Web deploy
Web deployWeb deploy
Web deploy
 
Visual studio 2017
Visual studio 2017Visual studio 2017
Visual studio 2017
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)
 
sikuli final
sikuli finalsikuli final
sikuli final
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
 

Similar to Topshelf - An easy service hosting framework for building Windows services using .NET

Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
franbow
 
Delphi - Howto Services
Delphi - Howto ServicesDelphi - Howto Services
Delphi - Howto Services
Niall Munro
 
OSDC 2014: Schlomo Schapiro - Test Driven Infrastructure
OSDC 2014: Schlomo Schapiro -  Test Driven InfrastructureOSDC 2014: Schlomo Schapiro -  Test Driven Infrastructure
OSDC 2014: Schlomo Schapiro - Test Driven Infrastructure
NETWAYS
 
OSDC 2014 Test Driven Infrastructure
OSDC 2014 Test Driven InfrastructureOSDC 2014 Test Driven Infrastructure
OSDC 2014 Test Driven Infrastructure
Schlomo Schapiro
 

Similar to Topshelf - An easy service hosting framework for building Windows services using .NET (20)

Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
 
Delphi - Howto Services
Delphi - Howto ServicesDelphi - Howto Services
Delphi - Howto Services
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Admin share point with powershell
Admin share point with powershellAdmin share point with powershell
Admin share point with powershell
 
Appium troubleshooting
Appium troubleshootingAppium troubleshooting
Appium troubleshooting
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
OSDC 2014: Schlomo Schapiro - Test Driven Infrastructure
OSDC 2014: Schlomo Schapiro -  Test Driven InfrastructureOSDC 2014: Schlomo Schapiro -  Test Driven Infrastructure
OSDC 2014: Schlomo Schapiro - Test Driven Infrastructure
 
OSDC 2014 Test Driven Infrastructure
OSDC 2014 Test Driven InfrastructureOSDC 2014 Test Driven Infrastructure
OSDC 2014 Test Driven Infrastructure
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!
 
Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016
Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016
Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony LinAnsible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
 
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARISAMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
 
OSTU - Using Microsoft Netsh (by Tony Fortunato)
OSTU - Using Microsoft Netsh (by Tony Fortunato)OSTU - Using Microsoft Netsh (by Tony Fortunato)
OSTU - Using Microsoft Netsh (by Tony Fortunato)
 
Red hat 3
Red hat 3Red hat 3
Red hat 3
 
Automation Suite PPT (2).pptx
Automation Suite PPT (2).pptxAutomation Suite PPT (2).pptx
Automation Suite PPT (2).pptx
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Free ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connectionFree ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connection
 
Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basics
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 

More from Larry Nung

More from Larry Nung (20)

Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automation
 
sonarwhal - a linting tool for the web
sonarwhal - a linting tool for the websonarwhal - a linting tool for the web
sonarwhal - a linting tool for the web
 
LiteDB - A .NET NoSQL Document Store in a single data file
LiteDB - A .NET NoSQL Document Store in a single data fileLiteDB - A .NET NoSQL Document Store in a single data file
LiteDB - A .NET NoSQL Document Store in a single data file
 
PL/SQL & SQL CODING GUIDELINES – Part 8
PL/SQL & SQL CODING GUIDELINES – Part 8PL/SQL & SQL CODING GUIDELINES – Part 8
PL/SQL & SQL CODING GUIDELINES – Part 8
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization formatMessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
 
PL/SQL & SQL CODING GUIDELINES – Part 7
PL/SQL & SQL CODING GUIDELINES – Part 7PL/SQL & SQL CODING GUIDELINES – Part 7
PL/SQL & SQL CODING GUIDELINES – Part 7
 
BenchmarkDotNet - Powerful .NET library for benchmarking
BenchmarkDotNet  - Powerful .NET library for benchmarkingBenchmarkDotNet  - Powerful .NET library for benchmarking
BenchmarkDotNet - Powerful .NET library for benchmarking
 
PLSQL Coding Guidelines - Part 6
PLSQL Coding Guidelines - Part 6PLSQL Coding Guidelines - Part 6
PLSQL Coding Guidelines - Part 6
 
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualitySonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code Quality
 
SikuliX
SikuliXSikuliX
SikuliX
 
protobuf-net - Protocol Buffers library for idiomatic .NET
protobuf-net - Protocol Buffers library for idiomatic .NETprotobuf-net - Protocol Buffers library for idiomatic .NET
protobuf-net - Protocol Buffers library for idiomatic .NET
 
PL/SQL & SQL CODING GUIDELINES – Part 5
PL/SQL & SQL CODING GUIDELINES – Part 5PL/SQL & SQL CODING GUIDELINES – Part 5
PL/SQL & SQL CODING GUIDELINES – Part 5
 
Regular expression
Regular expressionRegular expression
Regular expression
 
PL/SQL & SQL CODING GUIDELINES – Part 4
PL/SQL & SQL CODING GUIDELINES – Part 4PL/SQL & SQL CODING GUIDELINES – Part 4
PL/SQL & SQL CODING GUIDELINES – Part 4
 
Fx.configuration
Fx.configurationFx.configuration
Fx.configuration
 
StackExchange.redis
StackExchange.redisStackExchange.redis
StackExchange.redis
 
Disruptor
DisruptorDisruptor
Disruptor
 
GRUNT - The JavaScript Task Runner
GRUNT - The JavaScript Task RunnerGRUNT - The JavaScript Task Runner
GRUNT - The JavaScript Task Runner
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
Generic lazy class
Generic lazy classGeneric lazy class
Generic lazy class
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

Topshelf - An easy service hosting framework for building Windows services using .NET

  • 1. TOPSHELF - AN EASY SERVICE HOSTING FRAMEWORK FOR BUILDING WINDOWS SERVICES USING .NET Larry Nung
  • 4. INTRODUCTION  Put Your Apps on the Topshelf  An easy service hosting framework for building Windows services using .NET 4
  • 8. GETTING STARTED using System; using Topshelf; … class Program { static void Main(string[] args) { HostFactory.Run(x => { x.Service<Program>(s => { s.ConstructUsing(name => new Program()); s.WhenStarted(p => p.Start()); s.WhenStopped(p => p.Stop()); }); }); } public void Start() { Console.WriteLine("Service start..."); } public void Stop() { Console.WriteLine("Service stop..."); } } 8
  • 11. CUSTOM SERVICE using System; using Topshelf; ... class Program { static void Main(string[] args) { HostFactory.Run(x => { x.Service<ProgramService>(); }); } } class ProgramService : ServiceControl { public bool Start(HostControl hostControl) { Console.WriteLine("Service start..."); return true; } public bool Stop(HostControl hostControl) { Console.WriteLine("Service stop..."); return true; } } ... 11
  • 13. COMMAND-LINE service.exe [verb] [-option:value] [-switch] run Runs the service from the command line (default) help, --help Displays help install Installs the service --autostart The service should start automatically (default) --disabled The service should be set to disabled --manual The service should be started manually --delayed The service should start automatically (delayed) -instance An instance name if registering the service multiple times -username The username to run the service -password The password for the specified username --localsystem Run the service with the local system account --localservice Run the service with the local service account --networkservice Run the service with the network service permission --interactive The service will prompt the user at installation for the service credentials 13
  • 14. COMMAND-LINE start Start the service after it has been installed --sudo Prompts for UAC if running on Vista/W7/2008 -servicename The name that the service should use when installing -description The service description the service should use when installing -displayname The display name the the service should use when installing start Starts the service if it is not already running stop Stops the service if it is running uninstall Uninstalls the service -instance An instance name if registering the service multiple times --sudo Prompts for UAC if running on Vista/W7/2008 14
  • 15. COMMAND-LINE Examples: service install Installs the service into the service control manager service install -username:joe -password:bob --autostart Installs the service using the specified username/password and configures the service to start automatically at machine startup service uninstall Uninstalls the service service install -instance:001 Installs the service, appending the instance name to the service name so that the service can be installed multiple times. You may need to tweak the log4net.config to make this play nicely with the log files. 15
  • 23. REFERENCE  Topshelf  http://topshelf-project.com/  Welcome to Topshelf’s documentation! — Topshelf 3.0 documentation  https://topshelf.readthedocs.io/en/latest/index.html  Topshelf/Topshelf: An easy service hosting framework for building Windows services using .NET  https://github.com/Topshelf/Topshelf 23