0

I have wcf console application server and console application client.

I would like to attach a debugger to the WCF server if the client is in debug mode in order to debug the server services.

So the client would run this code on startup:

if (Debugger.IsAttached)
            Debugger.AttachToProcess("WCFProcessName"); //<<How this is done

Is it possible to do so?

Roi Shabtai
  • 2,981
  • 2
  • 31
  • 47
  • `Tools -> Attach to Process` or simply `ctrl + alt + p` in VS – Leri Oct 24 '13 at 13:00
  • @Leri As the question suggested I would like to do it in code - I would fix the title – Roi Shabtai Oct 24 '13 at 13:01
  • @YoYo I am really confused now. Do you want WCF service to start debugging itself? – Leri Oct 24 '13 at 13:02
  • @Leri - I fixed the question - I would like the client attach a debugger to the WCF service if the client has debugger attached – Roi Shabtai Oct 24 '13 at 13:05
  • See answer to this question: [Attach debugger in C# to another process](http://stackoverflow.com/questions/11811856/attach-debugger-in-c-sharp-to-another-process) – Shad Oct 24 '13 at 13:17
  • @Shad as the Comments in the post you suggested reply this does not the solution for in Code Attachment of debugger to another process – Roi Shabtai Oct 24 '13 at 13:25
  • @YoYo, but [this answer](http://stackoverflow.com/questions/11811856/attach-debugger-in-c-sharp-to-another-process#answer-11811881) describes hot to attach debugger to process from C# code. – Shad Oct 24 '13 at 13:35

0 Answers0