Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

How do I debug WCF?

The owner of the company has been working on upgrading the Windows Forms application for the past 5 years. He wrote the first one in 2002 with Web Services and he decided he wants a new version using new look-and-feel with WCF and not Web Services.

He's  given me the code to continue with this insanity :)

Code compiles, runs, I can log in but then code doesn't connect to WCF. I put debug steps in WCF and it doesn't even stop in the code.

I'll go step by step

1. This is how the project is set up :

User generated image
2. I run the code, log in, try some functionality and I get this error:

User generated image
3.  Looked at IIS Express and I see these running
User generated image
4. I don't see http://localhost:63680/SBTechTeamMembersService.svc in the list

5. I tried http://localhost:53457/ (this is in the list in step #3) in the browser and I see a list of code
    I tried  http://localhost:63680/ and I get page cannot be displayed.


So, the WCF is not running? If so, how can I start it? why the other WCFs are in the list and this one isn't?
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

Thanks, let me see. I'll post back.
You can right-click that project, then go to "Debug", then go to "Start new instance".

I did that and it starts in Debug mode. Anyway just to start it and not have it in Debug mode? If this WCF is in Debug Mode, I can run the main project.

"BackOffice" is the main project. I can't run it if the WCF starts in Debug.

User generated image
Right-click the solution, and go to "Set startup projects." See if your missing WCF project is set to start when debugging.

This is what I see

User generated image
User generated image
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can start both the main project ("BackOffice") and the WCF in Debug mode. But anyway to just start the WCF? I don't want to be in debug mode when I start the project all the time.
Thanks, ste5an. But it's too late to change this project to a new architecture. The owner started this 5 yrs ago.

If I can start both the "BackOffice" and the WCF without being in Debug mode....I can work with that.

If both have to start in Debug mode...I'll live with it. Annoying tho.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't think this can be called a "new architecture". It just a clean up of the existing one.

When we're not talking about 100.000 lines of effective code on the consumer side, then it is doable. Especially as this kind of refactoring will give you the time to learn a lot about the existing code.
And when there is no terrible technical debt, then the time needed to do this is covered by the time you will save later.

btw, the WCF services it self need normally no debugging. Only the layers used by it. Thus using unit test in those layers allow debugging the business and data access layer.

I have done such refactorings in the past in a lot of projects, where many people said it is not possible or worth the time. But I can surley say in the worst case I had the total time needed was the same as doing it without. But with the benefit that following update projects where done in almost half the time.
I'm curious:  why is having the other project in Debug mode an issue?

Not an issue. Maybe because I'm used to just starting the project without being in debug mode. I can live with starting both in debug mode.

I don't know where to set this one WCF to start automatically. Like the other WCFs in the project.

@ste5an --> thanks. I agree. The company I work for is behind technology. We're still on .Net 4.0. This one project is on 4.6.1
                       I'll look into cleaning it up.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Setup as multiple startup projects, and select both backoffice and WcfServiceSBTechTeamMemebers action to START

This works too.
Works. Stay safe and healthy.