Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1454
  • Last Modified:

How to debug wcf service code when app runs?

Using VS 2005. I have a wcf windows app which consists of a winform client and an wcf IIS hosted service (svc file). The whole app resides on a dev machine. The app wasn't developed by me.

I would like to debug the app so that I can step through the service code. I know the client calls a proxy method. When I put a breakpoint on the equivalent service code, VS says the source code is different from the original version. I don't know why this happens when I rebuilt the whole app. So I tick the checbox to allow this.

Now my question is how can I get the breakpoint to trigger on the service side. In debug mode, the client code just executes the method and I need to step through the whole method line by line.
My guess I need to have the debugger attach to the service by I am not sure how.

Thanks.
0
jentel2
Asked:
jentel2
2 Solutions
 
p_davisCommented:
System.Diagnostics.Debugger.Launch();

put this in the code that you want to step through on your service -- it will ask if you want to launch a new debugger.
0
 
joechinaCommented:
1) Start you windows application from VS 2005.
2) From menu, click Debug -> Attach to Process, find the process of your WCF service, and attach it.
3) Now the breakpoint in your service will be hit.
0
 
jentel2Author Commented:
I attached it to the dev web server and it worked. Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now