Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to debug wcf service?

user-image
Question added by Hasan Habib , Digital Transformation Specialist , Tritech
Date Posted: 2013/10/09
Rameez Ahmed Sayad
by Rameez Ahmed Sayad , .Net Consultant , Proximus Luxembourg

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.

Deepak Mishra
by Deepak Mishra , Lead Developer , Chevron

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

Thomas Manavalan
by Thomas Manavalan , System Developer and Business Analyst , Global Tours and Travels.

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. 

Samuel Eid Safwat Naguib
by Samuel Eid Safwat Naguib , Technology lead ,Project Manager ,Transformation Coach , Octalpha

When running a WCF service under IIS7, you need to attach your debugger to the w3wp.exe process, from an instance with administrative privileges.

عبدالرحمن محمد صالح احمد عبيد
by عبدالرحمن محمد صالح احمد عبيد , Web & Application Developer , Alkuraimi Bank

ms Visual Studio automatically creates proxy classes when run in Debug mode

Or start vistual studio prompt and write the command wcftestclient

More Questions Like This