views:

41

answers:

5

Hi,

I have created a WCF Data Service and using it in a web application which is the part of same solution. The WCF service holds the reference of another DLL(Utility.dll) which is also part of the same solution. I have added the service reference of the WCF service in the web application.

So the structure is

Solution

    |
    |- Utility Dll
    |
    |- WCF Data Service (has reference of Utility.dll
    |
    |- Web Application (have service reference of WCF Data service)

But something is going wrong in the Utility.dll and I want to debug it.

Can any one please let me know how to debug it using VS2010.

A: 

Set a breakpoint at the web method invokation in the client and run your application when the debugger stops at the breakpoint hit F11 to step into the web method code execution which will automatically attach to the service process.

A_Nablsi
A: 

I'm assuming you don't have the project that created Utility.dll.

If you have the debug symbols (.pdb) for the Utility.dll you can load the symbols and step into the code. Set a breakpoint before the call to the code in Utility.dll and run your project. When you hit that breakpoint, go to your Call Stack window (CTRL+ALT+C) and right click a frame that starts with Utility.dll, and choose "Load Symbols". You should get prompted for the .pdb location.

Chuck
A: 

Yes, you may set "WCF Data Service" as default project, then point svc file in Solution Explorer and hit Debug button (F5 normall). This will bring "WcfTestClient.exe" and connect to your new service and you will be able to debug your interface without any problems.

Kuznero
+1  A: 

You can also use a unit tests project to get the benefits of unit testing and possibility to launch the tests with the debugger.

Johann Blais
@Johann Blais : I think this should help me. I'll try it and mark it as a answer if it works for me.
Ram
A: 

Put both of your project in same solutions(WCF service and WCF Service TEst Client).

Add the "Project Reference" of the service in to your Test Client, using Add reference.

Set the default project to your test client.

set the break point in your service's contract Or any where you want.

Make sure you are calling the method from you client which is being set in you service's break point.

Make sure "Debug=true" is on for both projects.

Regards,

Mazhar Karimi

Mazhar Karimi