I have a simple solution with a test project and a windows application project in C#. If I make changes to the windows app project code and then click Run Tests from Test Manager, the windows app project does not get automatically recomplied. I have to recompile the project first, then run the tests. Since the windows app project is referenced by the test project, I would expect it to be compiled automatically if it has been modified.
Does anyone know if this is a bug or if there is a configuration setting to get this to work I have searched the web and looked through all the property pages and option settings without any luck.

Automatically compile references when running tests from Test Manager
RoryD
Hi Rick,
Yes it is true that to accomplish exactly what you want you have to go through some hacks. Setting your test project as startup project and then hitting f5 to run all of the tests in the project is one option; unfortunately there is no way to recompile everything and then run a specific test list with a single click. We are working on creating a better experience for next version. We really appreciate your feedback.
Thanks,
David Gorena Elizondo
[MSFT] VSTS
michaelp
Hi Rick,
The scenario that you are mentioning works that way by design, moslty for performance optimization reasons. When we run a test from test view or test manager, we recompile the project where the test lives, but we do not check for dependencies. If a solution contains many projects, checking for all its dependencies is very costly and would greatly affect performance. The workaround of course, is recompiling everything before you start your tests (you can use Ctrl + Shift + B to rebuild everything from the IDE)
Thanks,
David Gorena Elizondo
[MSFT] VSTS
Amos Soma
David,
Thanks for your quick reply.
I guess Test Manager is designed more for testers than developers. As a developer, I can't think of a reason that I would run the tests without wanting to compile first (if there were changes). If it doesn't compile, then tests will fail when they shouldn't, or worse yet, tests will succeed when they shouldn't leading to errors that wont be discovered until I do compile and the tests fail.
I did figure out that I can set the test project as my startup project and just run it and it will recompile everything and run the tests. This works, but is not ideal. Let's say I am working on Class A, so I am writing code and tests for Class A and I will be recompiling and running the tests often. This works OK, unless I have many other classes and tests in the same project. Then I am running many tests that I don't need to run. I want to be able to recompile the test project and the referenced project (which has Class A in it), then run just the tests for Class A. I can use Test Manager to organize the tests for Class A into a Test List, but I don't see a way to configure the test project to run a single test list when I run it.
Right now, it looks like I need to always remember to compile the solution every time before running the tests, or I need to have a separate Test Project for each class to be able to run the tests quickly and efficiently. I might be able to add a build action to the test project that would recompile the referenced project every time, but that is somewhat of a hack.
Let me know if you have a simplier solution.
Thanks,
Rick M.