Once the steps needed to build the service is over, it should be installed. Following are the steps to do it.
1. Save the project.
2. Build the service’s executable file. Build | Build menu item.
3. Open the Visual Studio .NET Command Prompt item from the start menu. It will be installed as a subitem of the Visual Studio .NET Tools item. This shortcut sets all the path necessary before going to the DOS prompt. Change the folder to the location where the executable is located. It will be found in the bin folder within the folder where the project is stored.
4. Install the service. This can be done by using the InstallUtil tool that comes with the Visual Studio. Use the following command line:
5. Start the service. This can be done by running the Windows Service Manager. In the services list, the service now installed will be listed as Service1. Right click and start the service.
6. Now, any Startup events can be viewed by opening the Event Viewer. Select the Application log, and any entries send to the log can be seen there.