0

I have a bit of a strange scenario that I can't figure out. I have some c# code that will start another process using 'process.start()' The process in question is a custom tool I have written so I have full access to the code. Is there a way that I can use breakpoints in this 'custom tool' process? I know how to do it with 'attach debugger', but that is a manual approach as opposed to an automatic one. Is this sort of thing possible?

EDIT: I suppose I could just launch the remote debugger process instead of my 'custom tool' ?

A.R.
  • 15,405
  • 19
  • 77
  • 123
  • 1
    why wouldn't you want to test that executable separately? – BrokenGlass Mar 13 '11 at 00:01
  • Possible duplicate: http://stackoverflow.com/questions/4814361/how-can-i-start-another-process-in-debug-mode-in-visual-studio-2010 – vcsjones Mar 13 '11 at 00:05
  • 1
    possible duplicate of [How do I attach a process to the debugger in Visual Studio?](http://stackoverflow.com/questions/986470/how-do-i-attach-a-process-to-the-debugger-in-visual-studio) – ChrisF Mar 13 '11 at 00:34
  • The custom tool is for post-unit test analysis. Since it is a custom tool, still in development, sometimes it has problems of its own. Not that this has anything to do with the question. – A.R. Mar 13 '11 at 00:41
  • @A.R. - It does. It helps with determining a good approach. Have you thought about using Process.GetProcesses() in debug mode instead of starting a new one. You could use VS2010's multiple startup at that point. – Ritch Melton Mar 13 '11 at 00:46
  • No, the question is complete on its own. Not trying to fight about it. Attaching to a running process is not what I want to do and I think that is clear. A 'good approach' is subjective at best. Think of the question in terms of pure technical challenge. – A.R. Mar 13 '11 at 02:31

1 Answers1

1

What exactly do you mean when you say "use breakpoints"? Do you want to attach debugger automatically on process startup?

Have you looked at ImageFileExecutionOptions registry key? It allows you to set a debugger that can be automatically attached to a proces when it starts up.

feroze
  • 7,380
  • 7
  • 40
  • 57
  • That is useful information, but I don't really want to make changes to the registry to accomplish this. Not that I don't think it would work, just that it is a bit too roundabout. Good tip though! – A.R. Mar 13 '11 at 00:30
  • OK, I've done some more research, and it seems that this is probably the only reasonable way. I think this thread is approaching being closed, even though it isn't really a duplicate. Thanks again! – A.R. Mar 13 '11 at 00:47