C # procedure for creating and installing a service program

Source: Internet
Author: User

To install the service program, follow these steps:

Add the installer to the Service Application
1. In Solution Explorer, access the design view of the service for which you want to add and install components.

2. Click the background of the designer to select the service itself, instead of any content.

3. When the design appliance has focus, right-click and click "add installer ".

In this case, a new ProjectInstaller class and two installation components ServiceProcessInstaller and ServiceInstaller are added to the project, and the service attribute values are copied to the component.

4. Click the ServiceInstaller component to verify that the value of the ServiceName attribute is the same as that of the ServiceName attribute of the service.

5. To determine how to start the service, click the ServiceInstaller component and set the StartType attribute to an appropriate value.
StartType:
Value result
Manual
After the service is installed, you must start it manually. For more information, see How to: Start a service.
Automatic
The service is automatically started every time the computer restarts.
Disabled
The service cannot be started.

5. To determine the security context of the service to be run, click the ServiceProcessInstaller component and set the appropriate attribute value. (For example, if you want to use a system user, select LocalSystem instead of user)

7. rewrite all methods for which custom processing is required.

8. Create your installation project and custom Operations to deploy and install your services.

Follow these steps to complete the installation of the service program. After compilation, you can install the service program.
After the installation is successful, you can open the service in the control panel to check whether the service program you just installed exists.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.