KevinBurton

If I have a IIS hosted WCF service how and what do I attach to in order to debug the service In general is there a way to tell the name of the WCF service that is running so that it can be attached to and debugged.

Thank you.



Re: Windows Communication Foundation (Indigo) Debug a WCF service?

JonCole - MSFT

Are you running IIS 5 or 6 IIS 6 has a process "w3wp.exe" (a system service) that you can attach a debugger to. I don't remember the name of the process in IIS 5, but I can find out if you need me to.




Re: Windows Communication Foundation (Indigo) Debug a WCF service?

KevinBurton

It is IIS 6 but it seems that things are different for WCF because I looked for the w3wp.exe process and it never showed up.

Kevin





Re: Windows Communication Foundation (Indigo) Debug a WCF service?

Sajay - MSFT

If you are using the visual studio debugger you can check the show all processes in the "Attach Process" dialog and you will see w3wp.exe there. Now make sure your service is running before the proccess is running by trying to view the service in the browser. This would cause the process to be activated.

Thanks
Sajay






Re: Windows Communication Foundation (Indigo) Debug a WCF service?

KevinBurton

I am also using the WCF software factory. When that is enabled and I try to "view in browser" I get one screen. When I turn the guidance package off and supply a URL to my browser I get what appears to be a directory listing of the physical location of the service. You would not happen to know the difference between these two Anyway back to the main question. When I 'view in browser' I do not see w3wp.exe. I do see WebDev.WebServer.exe. Has w3wp.exe been replaced



Re: Windows Communication Foundation (Indigo) Debug a WCF service?

Sajay - MSFT

webdev is the web server that comes with visual studio for development of web projects. what i understood right now is that have not hosted your site in IIS. Probably you have a file system hosting set up and that means VS is setting up the site in the development server and in that case webdev would be the process you need to attach to your debugger.

Also if you need to check if you are hosting in IIS, you can open up IIS management console and check the virtual directory from there.If you have a mapping there and you would be able to view your svc file from there then you can make sure your host is IIS. Also what is the URL that you are typing on the browser.






Re: Windows Communication Foundation (Indigo) Debug a WCF service?

KevinBurton

The specific URL that I am using to view the service in a browser is like

http://localhost:4674/MyCompany.Services.Host/CompanyServices.svc





Re: Windows Communication Foundation (Indigo) Debug a WCF service?

dslater1

I have a related question:

Is it possible debug WCF service using "Cassini" (internal) web server using a secure (https/SSL) connection via Visual Studio 2005 or do you have to run under IIS (with SSL certificate)

Duncan.





Re: Windows Communication Foundation (Indigo) Debug a WCF service?

Sajay - MSFT

Looks like you are using the development web server that comes with visula studio and not hosted this is IIS unless your IIS is running on 4674.

You will have to attach the debugger to the webdev process if you want to step through.

Regarding configuring https on cassini i havent done this before and not sure its possible as the development server is only for testing asp.net and not sure if it has support for SSL.






Re: Windows Communication Foundation (Indigo) Debug a WCF service?

pallz

I m using Windows Vista for hosting the WCF service on my IIS 7.0

I read the following somewhere

"To diagnose problems with Windows Communication Foundation solutions in development, the most important tool is the Visual Studio 2005 debugger. Generally, one can simply set breakpoints in the code for a client or service, and start debugging one¡¯s code.
In the case of a service, when one starts debugging it within Visual Studio 2005, Visual Studio automatically attaches its debugger to the host process. When the service is being hosted within IIS, one must attach the Visual Studio 2005 debugger to the host process manually. Doing so requires two steps.
The first step is to cause IIS to actually have the service loaded into an application domain. That can be done either by having a client invoke the service, or by browsing to the location of the service¡¯s .svc file to view the service¡¯s help page.
The remaining step is to actually attach the Visual Studio debugger to the host process. One begins doing that by choosing Debug | Attach to Process from the Visual Studio menus. Then, on Windows Server 2003, one selects w3wp.exe from the list in the Attach to Process dialog, and on Windows XP, one selects aspnet_wp.exe, those being the processes in which IIS hosts Windows Communication Foundation services. Finally, one clicks on the Attach button. Then, any breakpoint set in the code for the service can provide a starting point for stepping through it.
Evidently, while it is not especially difficult to debug services hosted in IIS, it is a little more challenging. Therefore, it is recommended to follow the approach shown in this chapter, of first hosting the service within one¡¯s own .NET application, and thoroughly debugging it within that process, before proceeding to host the service within IIS."

I enabled "Show all the process" etc...

but cant see w3wp.exe or aspnet_wp.exe

what more