`

How to debug windows service

阅读更多
1) Add such code to the service's entry, static Main() function,

#if DEBUG
            System.Diagnostics.Debugger.Launch();
#endif

2) install your windows service appliation with visual studio command tool. command line as follow:

installUtil.exe <Application's name>

3) Open your windows service source code with visual studio, start your windows service at service tool (you can find it at administrator's tool control panel),
then it will pop-up a dialog ask you if want to debug, select yes, that's ok, you can debug your application.

4) If you have modified your source code, you need uninstall the windows service, build your source code, reinstall agian.
分享到:
评论

相关推荐

    How to debug Windows services

    This method is similar to the method that you can use to attach a debugger to a process and then debug a process

    Windows_Service_Oracle_Database.zip_Windows Service_inside

    Windows Service application. ...Shows (in source code) how to debug a windows service via #ifdef _DEBUG directive. Also demonstrates updating Oracle and sending email inside a Windows Service

    Beginning JavaScript with DOM Scripting and Ajax: Second Editon

    you will also learn how to work with the Browser Object Model, the Document Object Model (DOM), how to use XML and JSON as well as communicate with service side scripts such as PHP. Find out how to: ...

    Beginning JavaScript with DOM Scripting and Ajax (pdf + ePub)

    you will also learn how to work with the Browser Object Model, the Document Object Model (DOM), how to use XML and JSON as well as communicate with service side scripts such as PHP. Find out how to: ...

    UE(官方下载)

    The all new auto-hide child windows give you The all new auto-hide child windows allow you to maximize your editing space by hiding the child windows against the edge of the editor. Customizing ...

    Packt.Kali.Linux.2018.2nd.Edition

    Finally, you will learn how to gain full system-level access to your compromised system and then maintain that access. By the end of this book, you will be able to quickly pen test your system and ...

    Java邮件开发Fundamentals of the JavaMail API

    Instructions on how to download and install the JavaMail API are contained in the course. In addition, you will need a development environment such as the JDK 1.1.6+ or the Java 2 Platform, Standard...

    NewSID(光学习一下代码就可以了,没看清楚介绍别运行)

    In addition, the system administrator does not have to learn how to use unattended install or sysdiff, or create and debug install scripts. This alone saves hours of work. The SID Duplication Problem...

    DriverStudio 3.2 升级补丁

    environment variables, and paths. &lt;br&gt;· The details of the problem: settings, error messages, stack dumps, and the contents of any diagnostic windows. &lt;br&gt;· The details of how to reproduce ...

    MCAD/MCSD Self-Paced Training Kit: Developing Web Applications with Microsoft Visual Basic .NET and Microsoft Visual C# .NET, Second Edition

    Configure security features for Web applications, including authentication and authorization •Test and debug coding errors •Deploy applications to your server or hosting service •...

    VB.NET Developer's Guide(4574).pdf

    How Web Forms Differ from Windows Forms 464 Why Web Forms Are Better Than Classic ASP 465 Adding Controls to Web Forms 467 Exercise 10.2 Adding Web Controls to a Web Form 468 Code Behind 473 NOTE...

    Turbo C++ 3.0[DISK]

    1. How to Get Help 2. Installation 3. Features 4. Important Information 5. Testing Your Expanded Memory 6. Corrections to the On-line Help 1. HOW TO GET HELP ------------------- If you have any ...

    Turbo C++ 3.00[DISK]

    1. How to Get Help 2. Installation 3. Features 4. Important Information 5. Testing Your Expanded Memory 6. Corrections to the On-line Help 1. HOW TO GET HELP ------------------- If you have any ...

    ICS delphixe10源码版

    With Delphi XE2 and later, VCL 64-bit Windows targets are supported for Delphi only. Currently FireMonkey is partly supported for Delphi only (there are still a few non-ported components). ICS for Mac...

    Professional.MFC.with.VC6

    How MFC Reacts to Multiple Templates What Frames are For Status Bars and Toolbars CStatusBar CToolBar Docking Tool Tips Summary Chapter 5: Using Dialogs and Controls in MFC User Interfaces:...

    spring-boot-reference.pdf

    6. Moving to Production 7. Advanced Topics II. Getting Started 8. Introducing Spring Boot 9. System Requirements 9.1. Servlet Containers 10. Installing Spring Boot 10.1. Installation Instructions for ...

    MapView的使用

    Q:how to get distance between two GeoPoints in sdk 1.0 ? MapPoint.distanceSquared(MapPoint) is gone thaks!! A:you'll need to brush up on your trigonometry, and first compute the Haversine function ...

Global site tag (gtag.js) - Google Analytics