How to debug WCF programs

后端 未结 7 1166
执笔经年
执笔经年 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:52

    To debug a WCF service in visual studio 2010, go to Debug -> Attach to Process. Check "Show processes from all users", and choose w3p.exe if you are using IIS, or the name of the application if not. Put in a breakpoint, make the call, and then you can then start debugging.

    If it's a web application (I'd recommend this) you can right click on the project, go to the Web tab, and under Start Action choose "Don't open a page, wait for a request from an external application". Save and close this setting, then just hit F5 to start debugging.

提交回复
热议问题