Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a WCF service with two console applications simultaneously

I have a WCF web service which is responsible for managing work sent from our internal business applications to a distributed set of client applications.

I would like to be able to setup a console application to mock a internal application (to test sending work) as well as one to mock a client application (to test performing the work).

To do so, I would need to debug two console applications at the same time with the ability to step through code within the WCF service. Obviously [incorrect, see awswer], a Visual Studio solution can only have exactly one startup project; stepping through in that scenario is easy-peasy. But how can I step through the WCF service with TWO console applications at the same time? (Can/should it be done? Is there a better way to approach testing?)

like image 633
Steve Konves Avatar asked Jun 18 '12 18:06

Steve Konves


2 Answers

Obviously, a Visual Studio solution can only have exactly one startup project;

This is not true.

If you right click on the solution in Solution Explorer, and choose "Set StartUp Projects...", there is the option to have Multiple Startup Projects. This allows you to start both console applications in the debugger when you hit Debug.

like image 183
Reed Copsey Avatar answered Sep 28 '22 02:09

Reed Copsey


See Reed copsey's answer, but I would add that you can also run two copies of Visual Studio at the same time. Just load the solution into each instance of visual studio, set up your break points in the respective copy of visual studio and press run in each one.

like image 29
CodingGorilla Avatar answered Sep 28 '22 03:09

CodingGorilla