ServiceInstaller.Description Property

Definition

Gets or sets the description for the service.

[System.Runtime.InteropServices.ComVisible(false)]
[System.ServiceProcess.ServiceProcessDescription("ServiceInstallerDescription")]
public string Description { get; set; }

Property Value

The description of the service. The default is an empty string ("").

Attributes

Examples

The following code example sets the installation properties for a new Windows service application. The example sets the service name, along with the display name and description. After assigning the installation properties for the service, the example adds the ServiceInstaller object to the Installers collection.

simpleServiceProcessInstaller = new ServiceProcessInstaller();
simpleServiceInstaller = new ServiceInstaller();

// Set the account properties for the service process.
simpleServiceProcessInstaller.Account = ServiceAccount.LocalService;

// Set the installation properties for the service.
// The ServiceInstaller.ServiceName must match the
// ServiceBase.ServiceName set in the service
// implementation that is installed by this installer.
simpleServiceInstaller.ServiceName = "SimpleService";

simpleServiceInstaller.DisplayName = "Simple Service";
simpleServiceInstaller.Description = "A simple service that runs on the local computer.";
simpleServiceInstaller.StartType = ServiceStartMode.Manual;

// Add the installers to the Installer collection.
Installers.Add(simpleServiceInstaller);
Installers.Add(simpleServiceProcessInstaller);

Remarks

Use the Description property to describe the purpose of the installed service to the user. The user can view the service description in applications that display details for installed services.

For example, using Windows XP, you can view the service description with the Service Control command-line utility (Sc.exe) or you can view the service description within the Services node of the Computer Management console.

Applies to

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also