views:

24

answers:

1

I have one solution WCFSampleSolution and it has all my projects - Web Service, Client and Website. The structure is something like:

  • WCFSampleSolution
    • C:\WCFSample\Website
    • WCFService
    • WCFWebClient

I created WCFService project for my services. It contains IService1.cs and Service1.cs. Then I hosted the service in IIS. I did this by creating a website and adding .svc and web.config files to the website project. Then published it in IIS. When I run http:\MyMachineName\Website\Service.svc, it shows the service description. Then I create the web client that calls the webservice. I used the service reference to add the service. It calls a method of Service1. It works fine. But I amnot able to debug this program/setup. I verified the config files in WCFWebClient project and Website project and they have proper debug settings.

<compilation debug="true">

I put break points but control never goes to my seb service. I also tried attach process, but it also doesn't work. But I was able to debug one of my other WCF projects. The setup was little different. In that project I copied the .svc file and config in my web client and the debug works fine.

Please HELP!!

+1  A: 

You are hosting your service on IIS so I am sure you must be attaching to w3wp.exe process. While trying to attach if VS built in web server is starting, then attach to that process as well.

Pradeep
Pradeep, thanks much for the response. I am not sure how to attach to w3wp? What I did is, opened VS 2008 and then Tools-> Attach to Process and selected aspnet_wp.exe. I am sure I am not doing it right, because after I attach I can't do anything on VS. Can you guide me how to do it? and also what does the last line mean?
aspnet_wp.exe is the right process to attach. I guess you are on Windows XP machine. You are taking the right steps. I have seen the behaviour where even if service is hosted in IIS, VS starts its on built web server "WebDev.WebServer40.exe" (I see this name in VS 2010). You also need to attach to it along side of aspnet_wp.exe. Can you also share your codebase so that I can also have a look.
Pradeep
Thanks Pradeep, I am not able to debug. What I was missing here is, the steps that I need to do fo rdebugging: I will put it here for others: 1. Put break points in client just before the call to web service method and also in the service method (important). 2. Run the application. 3. When control is on client break point, open Debug->Attach to Process and select aspnet_wp.exe. 4. Start debugging now. Voila!!!