

In Toolbox, expand Components, and then drag the EventLog component to the Service1.cs or Service1.vb tab. In Solution Explorer, from the shortcut menu for MyNewService.cs or MyNewService.vb, choose View Designer. The EventLog component is an example of the type of component you can add to a Windows service. In this section, you add a custom event log to the Windows service. From the Properties window, change the ServiceName value to MyNewService. In the Design tab, select Properties from the shortcut menu. Rename the file to MyNewService.cs or MyNewService.vb, and then press EnterĪ pop-up window appears asking whether you would like to rename all references to the code element Service1.

In Solution Explorer, select Service1.cs or Service1.vb, and choose Rename from the shortcut menu. Rename the service from Service1 to MyNewService. It includes much of the basic service code, such as the code to start the service. The project template includes a component class named Service1 that inherits from. The Design tab appears ( Service1.cs or Service1.vb ). NET desktop development workload using Visual Studio Installer.įor Name, enter MyNewService, and then select OK. If you don't see the Windows Service template, you may need to install the.
