What are the steps to create a windows service in VB.NET ?
The Windows Services are long-running executable applications that run in its own Windows session, which then has the ability to restart automatically when the computer boots and also can be manually stopped ,paused or even restarted.
The steps to create a window service in VB.NET are as follows:-
1) Create a project of type "Windows Service".
Figure: - Create project for Windows Service
2) If you view the class created it is automatically inheriting from "System.ServiceProcess.ServiceBase".
3) You can override the given events provided by the service and write your own custom code. All the 3 main events can be used that is Start, continue and stop.
protected override void OnStart(string[] args)
{
}
protected override void OnStop()
{
}
protected override void OnContinue()
{
}
1) Now to install the service you require to do run the install util exe.
InstallUtil \BIN\MyNewService.exe