Now we need to modify the service so that it does something useful. Initially this will not be a major change, but later on we will be expanding the service.
In Visual Studio, click the Tutorials.vb tab and you will again see the <OnStart> and <OnStop> code. We will modify both methods to write an entry into the Application log.
This simple application demonstrates the process of creating a service in Visual Basic 2008; modifying the design template provided by Visual Studio 2008; and creating, building, and then installing the service.
Click the <OnStart> method. Under the comments section, we’ll first add an error handler:
Try Catch ex As Exception End Try
You should never leave your code unprotected from exceptions, especially ...