How to choose which project is built on F5 in Visual Studio?

1

I have a solution file for IntraFace, which contains two projects, namely IntraFaceTracker and IntraFaceDetector (see the image). By default, IntraFaceTracker is selected, you can see its name is bold.

So when I press F5, Tracker project starts running. To run Detector project instead, I have to do it manually with the mouse cursor as in the picture.

So how can I change -temporarily- to run the Detector project on F5 ?

Thanks for any help in advance.

enter image description here

jeff

Posted 2014-03-12T18:50:31.947

Reputation: 489

Answers

1

The generic way to do this is to set the project that you want to run as the startup project. Then, that project will run on debug, build, or whatever you are running.

Note: This is not a temporary thing (i.e. it will not revert itself) but you can set the other project to be the startup project whenever you want.

soandos

Posted 2014-03-12T18:50:31.947

Reputation: 22 744

Ok, that's temporary enough for me :) Thanks ! – jeff – 2014-03-12T19:07:23.327

Actually this is the only way I know. Been using VS.net since before the first version in 2000 – Ramhound – 2014-03-12T19:45:16.877

@CengizFrostclaw, if it answers the question, can you please mark it as the answer – soandos – 2014-03-13T00:25:25.713

2

Not exactly what you want, but this may suffice as an alternative (since I don't believe a shortcut like you want exists inherently):

  • In the Solution Explorer right-click the Solution and pick Properties.
  • Select "Startup Project".
  • Select "Current Selection".

That way it will run/debug the currently selected project in the solution when you hit the shortcut keys.

Note: Same question found on StackOverflow: Run active project in Visual Studio 2010

Ƭᴇcʜιᴇ007

Posted 2014-03-12T18:50:31.947

Reputation: 103 763

1

Try the SwitchStartupProject extension, as suggested in this question. It adds a drop-down list to your toolbar that lets you switch startup project quicker than using the Solution Explorer.

Ashley

Posted 2014-03-12T18:50:31.947

Reputation: 101

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – DavidPostill – 2015-03-28T05:34:54.170

1Actually, I think this post contains all the necessary information, and there is nothing to be gained by copying or summarising any of the linked pages. The important point is that there is an extension called 'SwitchStartupProject'. Even if the Visual Studio gallery goes down one day, that will still be the name of the extension, and the reader will have to find it from another source. Further, the linked answer is almost exactly the same as mine; I only linked to it to credit the author of the extension. – Ashley – 2015-03-28T13:50:03.453