Solved

How to debug wcf service code when app runs?

Posted on 2008-06-12
3
1,441 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 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