Click here to Skip to main content
13,457,972 members
Click here to Skip to main content
Add your own
alternative version


10 bookmarked
Posted 16 Jul 2003

Windows Service Debugger

, 16 Jul 2003
Rate this:
Please Sign up or sign in to vote.
Macro which starts Windows service and attaches the debuger.
<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS--><!-- Download Links --> <!-- Add the rest of your HTML here -->


Debugging a Windows service using a VS.NET macro

 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>

While I started writing windows services I wished  Microsoft provided a way to debug with a single click as with the other project types.

I recently started reading about macros and here is a macro that can debug a windows service.


Running the macro

  1. Open Windows Service project you want to debug in VS.NET
  2. Open Macro Explorer.  Tools -> Macros -> Macro Explorer
  3. Load Macro Project in Macro Explorer
  4. Double click on “Debug” to run the macro.



Here is one of errors I got while I was creating the macro:

Unmanaged debugging not supported


Cause and Solution<o:p>

This happens when debugger tries to attach to the Windows service process.

For some reason it thinks it is an unmanaged process and hence it cannot attach itself.

 The solution for this is

Install VC++.NET  which includes unmanaged debugger.


For details on how to do that refer to:;en-us;813134


Hope this helps!!

Happy coding J







This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

United States United States
Sriram works as Senior Technical Specialist at Infosys's Microsoft Technology Center.

He has been working on ASP.NET,VB.NET,C#,ASP and SQL Server for past 7 years. He loves to churn out innovative ideas.

During his freetime,you may find him hiking, humming a song in his karaoke or listening to inspiring music. You can reach him at

You may also be interested in...


Comments and Discussions

GeneralUsing the macro Pin
KebTen26-Mar-06 0:22
memberKebTen26-Mar-06 0:22 
When I run the "Debug" macro from Macro Explorer - right click and run - I get the following message:

Cannot open <service name> service on computer '.'.
Confused | :confused:

Best regards,

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180323.1 | Last Updated 17 Jul 2003
Article Copyright 2003 by srirambalaji
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid