أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Depending on where you host the WCF , you can debug in slightly different ways.
1)Visual Studio automatically creates proxy classes when run in Debug mode (press F5)
2)If self hosted in WinForms , Console Apps or Windows Services , you need to run these applications in debug mode.
3) Is hosted in IIS , as described by others attach the IIS worker process to Visual Studio.
1.Use fault contract
http://wcftutorial.net/Fault-Contract.aspx
2. enable excption details in app.config.
<serviceDebug includeExceptionDetailInFaults="true" />
Get more details on debugging WCF service in
http://msdn.microsoft.com/en-us/library/bb514135.aspx
You can attach your web service application to the IIS worker process(W3WP.exe), on which the service is hosted and put break points in the web service application. Once any request to the service comes on the hosted service it will hit the break point in the web service. This method should be done only during unit testing.
During system testing or system integration testing or if the application is in production one of the below methods are suggested.
This is a very invasive way of debugging the web service. Ideally while developing the web service you should put logs and from the stack trace in the logs you should be able to identify your issue.
Other ways to debug your issues would be from the dump. Create a dump using dxdiag and read the dump using windbg.
When running a WCF service under IIS7, you need to attach your debugger to the w3wp.exe process, from an instance with administrative privileges.
ms Visual Studio automatically creates proxy classes when run in Debug mode
Or start vistual studio prompt and write the command wcftestclient