Using the current selected project as startup project in Visual Studio

- 1 minute read

A feature in Visual Studio which I noticed already being available in VS 2019 before, likely after an update, is the ability to set a project as startup in an alternative way.

In the past we only had the following options:

  • Single startup project
  • Multiple startup projects

Since the update, and it ships out of the box with Visual Studio 2022, we got another setting:

Current selection for Startup Project in Visual Studio 2022

What it does is simple: if you have focus on a file in a specific project that project becomes automatically the startup project. Just hit (ctrl +) F5 and get that project running.

When I have a file open in Console02 in my solution then by using the above mentioned Current selection setting Console02 automatically gets selected as the startup project:

Current selection is set to Console02

Something that happens to me from time to time is that when I’m so focussed on the code and F12 my way into code which is in a class library, that project then gets the focus and as you can guess: it just became the startup project. And no, that won’t start :bowtie:.

I noticed that this tip wasn’t as widespread as I thought it would be so here you go dear reader. Enjoy!

Leave a Comment