Solved

How to debug wcf service code when app runs?

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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