I have 2 projects: One of them is my program's project and the another one is my program's test project. I have setted my test project as my startup project, but when I run my program, the Visual Studio runs only the tests. If I try to set my program's project as my startup program, my tests do not run. There is a way to run both simultaneously? Or run the tests before my program?
Asked
Active
Viewed 205 times
1
-
6Why would you want to run the tests every time you run your program? – Brian S Mar 28 '14 at 03:51
-
@brian To be sure that nothing is going wrong and to better control what is running. Is that possible? – Vinicius Seganfredo Mar 28 '14 at 03:53
-
No, you want to run your tests every time you _build_ your program after a _change_, not every time you _run_ your program. – John Saunders Mar 28 '14 at 04:51
-
@john Yes, but I'm developing my code. I'm always changing and I want to run my tests with my program, so I don't need to always change the startup project when I want to see the tests results and see what is happening with my program – Vinicius Seganfredo Mar 28 '14 at 14:41
-
Which version of Visual Studio are you using? VS2013 can be configured to discover and run your unit tests on every local build, in the background. – John Saunders Mar 28 '14 at 16:04
-
@john I'm using VS2010 – Vinicius Seganfredo Mar 28 '14 at 23:40
-
1That's a good reason to upgrade. It's a very nice feature. It not only finds and executes your tests on every build - it does that in the background, so you don't have to wait for them to finish. – John Saunders Mar 28 '14 at 23:42
2 Answers
4
You cannot run two projects like that. But when one of your project is running, you can: 1. "right click" on another project 2. Go to "Debug" 3. Go to "Start New Instance".
You can run your both projets.. Try it..
Reference Link: http://iamfixed.blogspot.de/2017/10/run-multiple-projects-in-visual-studio.html

Sagar Dev Timilsina
- 1,310
- 15
- 32
-
This is not true - you can configure VS (at least some editions) to start multiple projects at the same time (running test along with program sounds strange... but possible). – Alexei Levenkov Mar 28 '14 at 05:18