Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Debug WCF Service?

I am creating a WCF service wherein mobile devices(Iphone & Android) and websites can connect to the service. I hosted my service on IIS7 and my IDE is VS2010.

When an Iphone connects on my service and call a certain function in which I placed a break point, visual studio won't stop or toggle to the breakpoint. I've tested it using web client and there was no problem debugging and adding the breakpoint.

I used WebInvoke on my wcf service. My configuration contains this line <compilation debug="true" targetFramework="4.0" />, both client and in the service.

Your help is greatly appreciated. Best,

like image 419
mr.b Avatar asked Jan 26 '11 05:01

mr.b


People also ask

How do I debug IIS hosted WCF service?

The easiest way to debug a self-hosted WCF is to configure Visual Studio to launch both client and server when you choose Start Debugging on the Debug menu. If the WCF service is self-hosting inside or a process that cannot be launched in this manner, such as NT service, you cannot use this method.

How do you debug a WCF Test client?

Visual Studio provides you a test client to run and debug the service. To use this test client, select your service in Solution Explorer ( CustomerProfile. svc ) and, from the Debug menu, select Start Debugging (or just press F5). Visual Studio will run the code in debug mode using the WCF Test Client, as shown in ...


1 Answers

When running a WCF service under IIS7, you need to attach your debugger to the w3wp.exe process, from an instance with administrative privileges. If you left the debugger running for a long time before calling the service from your phone, most likely the process was shutdown, and your debugger was no longer attached.

If that's the case, you can always modify the recycling condition settings of your application pools, so the process will remain alive for a longer time.

like image 110
Ramiro Berrelleza Avatar answered Oct 05 '22 17:10

Ramiro Berrelleza