Solved

How to debug wcf service code when app runs?

Posted on 2008-06-12
3
1,445 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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