Search code examples
wcfdebugging

WCF Beginner Tutorial - Unable to debug (step into)


I am doing the following tutorial http://msdn.microsoft.com/en-us/library/ms731835%28v=vs.100%29.aspx and the program is working perfectly fine. Both Service and Client are in different solutions. I can start the service from one visual studio and then run the client program successfully. However I want to do debugging. I want to step into Service code from Client code. When I try doing that, I get the following error.

"Unable to automatically step into the server. Attaching to the server process failed. A debugger is already attached."

Both client and server are console applications and service is slef hosted. I also tried enabling debug = true in the app.config file of client.


Solution

  • There are several possible options for what you're trying to achieve:

    1. As error specifies, client debugger can't attach to the server process because it's already got a debugger. Try starting server process without debugger.
    2. Putting client and server code into the same solution and then using RMC -> Debug -> Start new instance on your server and client projects
    3. Running server process with debugger and then using "Debug -> Attach to proces.." to attach to client code (it shouldn't be run with debugger)

    I'd recommend (at least for the time being) putting those two into the same solution for debugging purposes. It's easier to work with in the single workspace.