Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to debug wcf service?

user-image
Question ajoutée par Hasan Habib , Digital Transformation Specialist , Tritech
Date de publication: 2013/10/09
Rameez Ahmed Sayad
par 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
par 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
par 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
par 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.

عبدالرحمن محمد صالح احمد عبيد
par عبدالرحمن محمد صالح احمد عبيد , 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?