Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF can no longer step into a service that's locally hosted -- why not?

Tags:

debugging

wcf

I have a WCF test service and a test client in the same solution. The service is configured to run on localhost (Ie, "http://localhost:8731/Design_Time_Addresses/MyService/Service") I run the client app and it correctly invokes the service and gets back the correct answer. I've verified via logs that it's definitely running the service that's local to my machine. However, I can't debug into the service when running the client. WCF is supposed to allow just stepping through, but no breakpoints on the service get hit, and stepping in to the service call doesn't work either. Has anyone ever seen this?

I've checked all the obvious stuff like "is the PDB file being generated?" -- yes, it is. If I run the service project by itself, then hit it with some test client, breakpoints get hit correctly. So debugging on the service works. I can even explicitly "attach to remote process" and debug the service that way. But WCF will not automatically step from the client to the service.

like image 409
tavistmorph Avatar asked Aug 20 '09 16:08

tavistmorph


1 Answers

I've had this happen as well. Curiously it seems to happen after I make changes to the build configuration (from x64 to x86). Here's how I've been able to fix it:

  1. Right-click the solution, select Properties.
  2. Under "Startup Project" switch from "Single startup project" to "Multiple startup projects".
  3. Set Action to "Start" for the WCF project.

Even though I'm hosting the project in the local IIS server (not the VS Development Server) this solves it, which is a little puzzling. I suspect that setting a project to "Start" also causes VS to attach to the process for debugging.

http://msdn.microsoft.com/en-us/library/bb157685.aspx

like image 59
msulis Avatar answered Oct 05 '22 15:10

msulis