O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Create a Windows Service Installer

Problem

You need to install your Windows service so that you can run or test it.

Solution

Create an installer class, and use the InstallUtil command-line utility.

Discussion

Because Windows services are controlled by the SCM, you must install them before you can run or debug them. To install a Windows service, you must create an installer class. Microsoft Visual Studio .NET can generate this installer class automatically. In the Solution Explorer, simply right-click your service code file, choose View Designer, and select the Add Installer link that displays in the Properties window (as shown in Figure 13-1).

The Add Installer link.

Figure 13-1. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required