Jump to content
Jim McKeeth

Simplified "Attach to Process" debugging

Recommended Posts

It's been a long time since I've done much development with Windows services. I'm aware of the trick of creating a non-service version of the project, but sometimes that introduces subtle changes. I seem to remember a Host Application that would restart the service and then attach the debugger to the service. I know it is a little more complicated then that since you need to stop the service before compiling.

 

I imagine it worked something like this:

  1. Run from IDE
  2. Compiles
  3. Automatically stops service
  4. Links to EXE (or maybe it deployed it....)
  5. Automatically restart service
  6. Attaches debugger
  7. Productivity

 

image.thumb.png.3192810a9099d3c92e8a5387abbb65c6.png 

 

Is there a tool like this already? It might have been an in-house tool, or a fever dream.... All options are equally likely. If it was the latter two then I might try building it again.

 

Also, is there a list of macros like $(SanitizedProjectName) that are available in the IDE? I only found one mention of that one in the DocWiki, and that was only about a related bug fixes. There is the Transfer Macro list, but I believe some of those are specific to the Tool Properties, and it is still missing others like $(platform), $(target), etc. Completely unrelated, but there is a weird behavior I just noticed in the Tool Properties dialog. When you drop down the Macro's list, the edit boxes and labels all blank out. If you click the Insert button then it puts the dialog in a weird state too.

image.thumb.png.22e1b413523dda24f449b00cff04cfbe.png 

 

Thanks!

 

-Jim

Edited by Jim McKeeth

Share this post


Link to post

When I debug a service, I simply run the service normally in the SCM, and have its OnStart event pause execution until the debugger is attached. 

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×