views:

418

answers:

2

I have created a WCF service in Visual Studio 2010 along with some supporting assemblies. I have also created a test project which contains multiple unit tests for the service and the supporting assemblies. Right now I have them all in one solution with the Test project having a service reference (http) to the WCF service.

If I debug the WCF service and select "Run checked tests" in a Test List I created, I can debug the WCF service without a problem. Note: I cannot select Debug Checked Tests while debugging the WCF service. (Because the IDE is already debugging?)

If I open the Test project in another instance of VS 2010, debug the WCF service and then select "Debug Checked Tests" - I can debug both my tests and the WCF service.

However - I would like to (and my question is) be able to debug my tests and my service in a single IDE. Is this possible?

A: 

Are you running the WCF service in Cassini? If so, you should be fine, provided you have a service reference to the project from the calling code. It steps right through.

Hmm... at least it does in 2008, and I assume it does in 2010. I haven't tried it yet for 2k10; I'll go have a go at it and be back with a report.

Edit: Yep, it does.

Randolpho
A: 

I choose to host the wcf service in the same test process. So the test (maybe in the setup fixture) creates and opens the service host and at the end of the test, it closes/stops the service host. This will make debugging a breeze.

darthjit