Solved

How to debug wcf service code when app runs?

Posted on 2008-06-12
3
1,436 Views
Last Modified: 2013-12-17
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
Comment
Question by:jentel2
3 Comments
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 200 total points
ID: 21771752
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
 
LVL 13

Accepted Solution

by:
joechina earned 300 total points
ID: 21771763
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
 

Author Closing Comment

by:jentel2
ID: 31466652
I attached it to the dev web server and it worked. Thanks.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now