12

I have a Visual Studio 2008 solution that contains around 30 projects. Some of these are web services / WCF services / ASP.NET MVC applications.

When I run all unit tests (Ctr+R, A) it insists on spinning up all the Development Servers for these various projects. This means that it takes far too long to run the tests and, actually, none of my unit tests require these frameworks.

So, how do I stop Visual Studio doing this?

Charles
  • 48,924
  • 13
  • 96
  • 136
Chris Arnold
  • 5,613
  • 5
  • 30
  • 54

2 Answers2

13

Click on the projects in your solution and bring up the properties window (F4).

Change Always start when debugging to false.

womp
  • 111,854
  • 24
  • 229
  • 262
0

If you're running the tests, not debugging, then the "Always start when debugging" setting will have no effect.

Instead, have a look at the test settings that you're using to run the tests. (Find which settings you're using by going Test > Select Active Test Settings. You can then edit the test settings by going Test > Edit Test Settings and selecting your active test settings)

I have found the following test settings can force the ASP.NET development server to start up, although there could be more!

  1. Non-default test host: In the edit test settings window, choose the "Hosts" section. Host type should be set to "Default", not "ASP.NET"
  2. Code Coverage: In the edit test settings window, choose the "Data and Diagnostics" section. Select "Code Coverage" and click "Configure". The development server will start for each service that is selected here for ASP.NET Code Coverage. (Normal code coverage is identified by an icon of a blank page with two gears on top of it. ASP.NET code coverage is identified by an icon of a globe with two pages on top of it.) To change from ASP.NET code coverage to normal code coverage, deselect the ASP.NET code coverage, then choose "Add Assembly...". Browse to the bin folder of your web service project and choose the dll of the web service.
Dave C
  • 201
  • 5
  • 6