19

I want to get rid of the dialog saying

There were build errors. Would you like to continue and run tests from the last successful build

when I am running unit tests (I use test -> run -> all tests).

How do I do that? I already know how to disable it when running a normal project.

I also want to know how this can ever be a useful feature?

3
  • 4
    Looking for the answer to this, I found and voted for it on the vs suggestions site visualstudio.uservoice.com/forums/121579-visual-studio/… Commented Apr 17, 2013 at 8:14
  • What do you want to have happen instead? Do you want to automatically go ahead and test code that doesn't build, or do you want to automatically abort the tests? Commented Aug 6, 2014 at 23:54
  • 2
    The thing that I want to happen is that I should fix the build errors. Commented Aug 8, 2014 at 8:20

2 Answers 2

2
How do I do that?

You can't.

I also want to know how this can ever be a useful feature?

I find it useful when I am working closely with someone who is configuring test data. I can re-run tests to ensure new test data is valid, without having to worry about compiling any changes that I have done in the meantime.

For example if someone has changed some data in a database, I want to be able to run my tests to ensure that this new data is valid, and I want to be able to run the tests whether the current state of my code compiles or not.

4
  • So you are testing the test data then? I am not clear about what test data would mean in this context. Commented Aug 6, 2014 at 7:44
  • Not really. If you code doesn't build, then what are you testing? Commented Aug 6, 2014 at 23:53
  • Like I said, that the tests still pass with the new data
    – lockstock
    Commented Aug 6, 2014 at 23:55
  • And you want to run the tests even if code does not longer compile? How about going back in version to a compilable one then? Commented Aug 10, 2014 at 12:54
1

For Visual Studio 2017 / MSTestV2 you can do:

Tools > Options > Project and Solutions > Build and Run

"On Run, when build or deployment errors occur:" "Do not launch"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.