2

There are many, many projects in the VS solution my company has. Thing is, I need to build and run these 4 different C# projects of that solution: A, B, C and D, in that order.

How do I achieve that without buildrunning each separately.

I hope I'm not asking a duplicate question, but I'm really not sure what terms should I use to search for an already answered duplicate.

Guido Tarsia
  • 1,962
  • 4
  • 27
  • 45
  • Isn't it same? http://stackoverflow.com/questions/8053356/project-build-order-in-visual-studio-2010 – Farhad Jabiyev Apr 11 '14 at 15:53
  • From what I see, that post is about building, not about running them. – Guido Tarsia Apr 11 '14 at 15:59
  • Are you saying you would like to press a button and have all 4 projects build and then run? Have you tried macros? – Rick S Apr 11 '14 at 16:05
  • *Running* your projects in order is a concept unknown to VS. You can *build* them in a predefined order or *run* multiple projects simultanously (by hitting F5). – Filburt Apr 11 '14 at 16:05

2 Answers2

1

Building/Running your projects as a group is easy, but building them in your own order is not. Remember that dependencies determine the order in which projects are built.

To build them as a group, simply place them all in the same Solution folder and invoke build on them: Build as a group

To run them as a group, you have a few choices:

  1. Use the Solution Properties to run multiple projects (VS will run them "simultaneously" - you won't have control over the order).
  2. Use Project Properties to run a batch file as an external application. In the batch file you can run them in a certain order.
  3. Create a 'Launcher' project to launch the projects in any order you like, with any delays you like, check that one app is initialized before running the next, etc.
HiredMind
  • 1,827
  • 17
  • 27
0

When you run a project, VS will automatically do any and all building necessary to run your startup project. It will also determine this order for you based on the dependency tree. You shouldn't need to edit this under most circumstances. VS lets you do so by editing the dependencies. Right click on your project and select Build Dependencies > Project Build Order to see the current build order and edit your dependencies, which will affect the build order.

While debugging, you can right click on another project you want to run and select Debug > Start New Instance to run that project in addition to your startup project.

DLeh
  • 23,806
  • 16
  • 84
  • 128