Answered by:
Having troubles debugging my WCF service

Question
-
I'm having lots of trouble trying to debug my WCF service. I've got a WCF service that users TCP as the transport. I've written a Windows service application to host my WCF service. The WCF service and the Windows service are in different solutions, different folders. And now I've got a simple WinForms client application (again, in its own solution/folder) which I want to use to do some simple tests of the WCF service. However, when I attempt to step into the call to the WCF service, it simply refuses to let me do it. My operations are two-way operations. I've got the following code in all of my app.config files:
<system.web> <compilation debug="true" /> </system.web>
How do I make this work? Do I have to have the WCF service loaded, and running in VS 2008, and the Windows service also loaded, and running, in VS 2008, as well as the WinForms all loaded, and running, in VS 2008?
RodFriday, March 20, 2009 4:23 PM
Answers
-
Because of the way I constructed this whole thing, I found that it was causing me problems. I have a solution for my WCF service, a separate solution for the Windows service which hosts my WCF service, and a third solution for my client application. Although this is workable, this causes a little too much complexity. I found that I was referencing the production version of the WCF service from the Windows service, even though I had compiled everything with debugging enabled. In other words, I couldn't step into the WCF code, because it wasn't the version that had the debugging information included.
In the future I will put WCF service (and associated classes) into the same solution as my Windows services, of the Windows service is to host my WCF service!!
Rod- Marked as answer by Rod at Work Friday, March 20, 2009 8:15 PM
Friday, March 20, 2009 8:15 PM
All replies
-
Hi Rod,
you should install and start your Windows service (that will initialize your WCF service) and then try debuging your application by attaching the process you want to debug to the Visual Studio debugger.
Regards,
John
- Proposed as answer by Will.Rogers Friday, March 20, 2009 5:45 PM
Friday, March 20, 2009 4:38 PM -
You can also automatically attach to a running service at the appropriate spot by inserting a call to System.Diagnostics.Debugger.Launch() into your service code at the exact location where you wish to break.
- Proposed as answer by Will.Rogers Friday, March 20, 2009 5:48 PM
Friday, March 20, 2009 5:47 PM -
Because of the way I constructed this whole thing, I found that it was causing me problems. I have a solution for my WCF service, a separate solution for the Windows service which hosts my WCF service, and a third solution for my client application. Although this is workable, this causes a little too much complexity. I found that I was referencing the production version of the WCF service from the Windows service, even though I had compiled everything with debugging enabled. In other words, I couldn't step into the WCF code, because it wasn't the version that had the debugging information included.
In the future I will put WCF service (and associated classes) into the same solution as my Windows services, of the Windows service is to host my WCF service!!
Rod- Marked as answer by Rod at Work Friday, March 20, 2009 8:15 PM
Friday, March 20, 2009 8:15 PM