CHAPTER 18 600 THE .NET REMOTING LAYER (Web hosting solutions)

CHAPTER 18 600 THE .NET REMOTING LAYER Figure 18-8. Including an installer for the custom Windows service Figure 18-9. Establishing the identity of the CarService Adding a Service Installer Before you can install your service on a given machine, you need to add an additional type into your current CarWinService project. Specifically, any Windows service (written using .NET or the Win32 API) requires a number of registry entries to be made to allow the OS to interact with the service itself. Rather than making these entries manually, you can simply add an Installer type to aWindows service project, which will configure your ServiceBase-derived type correctly when installed on the target machine. To add an installer for the CarService, open the design-time service editor (by double-clicking the CarService.cs file from Solution Explorer), right-click anywhere within the designer, and select Add Installer (see Figure 18-8). This selection will add a new component that derives from the System.Configuration.Install. Installer base class. On your designer will be two components. The serviceInstaller1 type represents a specific service installer for a specific service in your project. If you select this icon and view the Properties window, you will find that the ServiceName property has been set to the CarService class type. The second component (serviceProcessInstaller1) allows you to establish the identity under which the installed service will execute. By default, the Account property is set to User. Using the Properties window of Visual Studio 2005, change this value to LocalService (see Figure 18-9).
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

Leave a Reply