What setting controls whether Visual Studio builds a solution when running tests or not?

155 views Asked by At

We have two distinct team projects, both running in TFS 2013 / VS 2013. One of them always builds the whole solution when asked to run all tests in the Test Explorer window, while the other one does not build anything and just tries to run the tests again.

Sometimes we would like to prevent VS from building the whole solution, since we know it did not change or we just don't want to test against the modified changes, for instance.

What setting controls this behavior? I can't really see any differences between both projects to warrant different test behavior. I'm not using any settings file in neither of them, and this was tested with both projects completely cleaned (like deleting the .suo file for example).

2

There are 2 answers

3
PiotrWolkowski On

I'm aware of two things that may help.

  • Set files in your solution to Do not copy or Copy if newer
  • In Tools -> Options -> Projects and Solutions -> Build and Run check the checkbox: Only build startup projects and dependencies on Run

I'm working with these settings and I don't have the issue thought I cannot guarantee it will help in your case.

0
vijayinvites On

To build only few projects, you can create a sub solution - meaning the solution will have only few projects and their dependencies.

To stop building every time, use the tools-options-Projects and solutions->Build and run

check, build only the Startup projects and dependencies and select "never build" in the drop down "On run, when projects are out of date"