How to debug WCF programs

后端 未结 7 1212
执笔经年
执笔经年 2020-12-31 01:21

My code uses lots of WCF calls and when I try to debug it, it doesnt go to the service code itself. Is there a way to debug WCF code somehow?

7条回答
  •  情话喂你
    2020-12-31 01:34

    When running an application that accesses WCF services there are often two processes involved

    • The client process which is accessing the WCF service
    • The server process which is hosting the WCF service

    It sounds like you are debugging the client process. In order to step through the actual WCF service code you need to attach the Visual Studio Debugger to the process which is hosting the service and set a break point in the code.

    Note: Visual Studio can attach to multiple processes simultaneously so you can debug both your client and server code in the same session. Use

    • Tools -> Attach to Process

提交回复
热议问题