Windows Service-create and install

Source: Internet
Author: User

1. What is Windows service?
Windows service applicationsProgramIt is an application that requires long-term running. It is especially suitable for the server environment. It does not have a user interface and does not produce any visual output. Any user message is written into the Windows event log. When the computer starts, the service automatically starts running. They do not run only when users log on. They can run in any user environment including the system. Through the Service Control Manager, Windows Services are controllable and can be terminated, paused, and started as needed.

2. Create a Windows Service
When the service is started, an entry is registered to a database to indicate that the service has been started. During service running, it regularly creates a database project record at a specified interval. When the service is stopped, the last database record is created. This service automatically registers with the Windows Application log the records when it is successfully started or stopped.
3. Composition of Windows Services

    • Dispose-clear any managed and unmanaged Resources)
    • Onstart-Control Service Startup
    • Onstop-Control Service stop

4. Install Windows Services
To install a Windows service, you must use installutil.exe of. Net framework.exe, or use a file deployment project such as Microsoft Installer (MSI.

5. Add a service Installer
It is not enough to create a Windows Service and only use the installutil program to install the service. You must add a service installer to your Windows Service so that installutil or any other installer can know how your service is configured.

6. Use installutil to install Windows Services

7. debug Windows Services

8. Add a running Windows Service

From: http://www.cnblogs.com/tuyile006/archive/2006/11/27/573654.html

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.