In Visual Studio there is a problem with how WCF Service Application projects are built and the effect is that 50% of unit test runs fail.
Take the following scenario:
1) Start new VS 2010 solution
1) Created 3.5 WCF Service Library
2) Created second executable project
3) Created third unit test project
4) In the Wcf options for the WCF service library, disable Start WCF Service Host
Run unit tests and half of the tests will fail as they are not able to start QTAgent32.exe
It looks like the problem is that VS insists on building the WCF Service Library project EVERY time.
The only workaround is to remove the WCF extensions from the csproj file.
This is a specific instance of bug 536475.