如何调试WCF程序 [英] How to debug WCF programs

查看:156
本文介绍了如何调试WCF程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的code使用大量WCF的电话,当我尝试调试它,它不进入C本身的服务,$ C $。有没有办法以某种方式来调试WCF code?

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?

推荐答案

您需要将调试器附加到您的WCF服务在运行的进程。

You need to attach the debugger to the process that your wcf service is running in.

如果在IIS中您需要连接到相应的w3p.exe过程。

If in iis you need to attach to the corresponding w3p.exe process.

如果在一个独立的应用程序或窗口服务,连接到你的exe文件的名称。

If in a stand alone app or windows service, attach to the name of your exe.

在Visual Studio中,调试菜单上,有一个附加到进程。打开相关的code,设置一个断点,并调用该服务使处理器执行的code路径。

In Visual Studio, on the debugger menu, there is an "attach to process". Open the relevant code, set a breakpoint, and call the service causing that code path to execute.

调试之外,使用.NET跟踪与切换水平是一个很好的方式来获得洞察力,这是怎么回事。我通常设置SYS内部DebugView的颜色突出显示错误和警告,并不断有它运行在运行code或测试。彩色线条勾勒出我的余光工作时发现的问题。

Outside of debugging, using .net tracing with switchable levels is a good way to get insight to what's going on. I typically setup sys internals debugview to color highlight errors and warnings and constantly have it running while running code or tests. Colored lines out of my peripheral vision while working finds issues.

这篇关于如何调试WCF程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆