Debug Windows Service

Source: Internet
Author: User

1. Install service: installutil yourservice.exe

2. uninstall service installutil/u yourservice.exe

If the service is running, the command will stop serive and uninstall it.

3. Start Service Net start "your service"

"Your service" is the value of system. serviceprocess. serviceinstaller. servicename in the projectinstaller class. It is the service name that you can see in the Service Manager.

4. debug the service and start Visual Studio 2008. Open your yourservice project. Select "debug-> attach to process ...".
5. Attach yourserice.exe in the attach to process window. If you cannot see your yourserice.exe, select "show processes from all users". Then you can see the service running with the system account. If you have set a breakpoint, when serice runs to the breakpoint you set,ProgramIt will stop and wait for your debugging.
6. yourservice.exe must be compiled in debug mode.

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.