Install Windows developed by. net

Source: Internet
Author: User

Windows Services are different from other common services. Windows ApplicationProgram, You cannot simply run EXE File to start it. Windows Service should be used . NET Framework Provided Installutil.exe Or use a deployment project, such Microsoft Installer ( Msi ) File.
Add installer
Only created Windows Service unavailable InstallutilProgram to install it. You must give it to you. Windows Add an installer for the service. Installutil Or other tools to know the specific configuration of the service.
1. Switch to the service design mode
2. Right-click and choose add installer
3. Switch to the new Projectinstaller Design Mode
4. Set Serviceinstaller1 Component attributes:
Servicename = My Sample Service
Starttype = automatic
5.Set Serviceprocessinstaller1 Component attributes:
Account = LocalSystem
6. Generate a solution

UseInstallutilInstallWindowsService
Now you need to install your service. Follow the steps below to install your service.
1.OpenVisual StudioCommand Prompt
2.Switch to storageWindowsService generated. ExeFile directory;

3. enter installutil youservice.exe to register your service, it will add the required registry information.
4. right-click my computer on the desktop, and choose manage.
5. select a service in the service and application, and you can see your service in the list
6. right-click your service and choose start
if you need to change your Windows service anytime, You Need To uninstall and reinstall it. Before detaching a service, you must close the Service Management Console. Otherwise, problems may occur during detaching. To uninstall the service, you only need to enter the same command as when registering, but add /u next to it.

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.