65.9K
CodeProject is changing. Read more.
Home

Windows Service Debugger

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.56/5 (9 votes)

Jul 17, 2003

viewsIcon

42845

downloadIcon

464

Macro which starts Windows service and attaches the debuger.

Introduction

Debugging a Windows service using a VS.NET macro

 

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.

 

Troubleshooting

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

Unmanaged debugging not supported

 

Cause and Solution

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:

http://support.microsoft.com/default.aspx?scid=kb;en-us;813134

 

Hope this helps!!

Happy coding J