Marek Grzenkowicz
Marek Grzenkowicz

Reputation: 17383

Can I configure Visual Studio NOT to change StartUp Project every time I open a file from one of the projects?

Let's say that there is a solution that contains two projects (Project1 and Project2).

Project1 is set as a StartUp Project (its name is displayed in a bold font). I double-click some file in Project2 to open it. The file opens, but something else happens too - Project2 gets set as a StartUp Project.

I tried to find an option in configuration to change it, but I found none.

Can this feature (though it's more like a bug to me) be disabled?

Upvotes: 23

Views: 10487

Answers (5)

sergiol
sergiol

Reputation: 4335

I began to had an horrible behavior from Visual Studio, the last time I reinstalled it. Basically whenever I clicked something on Solution Explorer, the project including that something, was automatically set as the Startup Project.

Then I figured it out, the culprit was the option "Current Selection" option, on the solution's Properties > Common Properties > Startup Project:

enter image description here

As in my case, I always have the same project I want to start, I changed to the "Single startup project" option and chose such project, and clicked OK button, then problem solved!

Upvotes: 0

LarsVegas100
LarsVegas100

Reputation: 59

If you are using ReShaper (A JetBrains Product). In my case I used ReShaper and I can change this with "CTR + Shift + Alt + R You can set or delete the Start Settings. But before this time I have only set the Start Project via VS and ReShaper was installed too!

Upvotes: 2

ShawnFeatherly
ShawnFeatherly

Reputation: 2638

I ran into a bug where the project in bold would not be the startup project despite it being selected in the solution properties as the "single startup project".

One work around for this bug was un-checking deploy, from the Configuration Manager, for the non-bold project that was being incorrectly used as the startup project. The configuration manager is found by right clicking the solution in the Solution Explorer.

Upvotes: 0

Lea Cohen
Lea Cohen

Reputation: 8200

The way to select a startup project is described in Sara Ford's blog "Visual Studio Tip of the Day" (highly recommended). She has a post there about setting up StartUp projects. Essentially there are 2 ways, the easiest one being right-clicking on the desired project, and choosing "Set As StartUp Project". That prevents other projects from becoming the StartUp project, even if you click on one their files.

Upvotes: 19

kokos
kokos

Reputation: 43644

Check your Visual Studio options for the following check box:
Projects and Solutions - Build and Run - For new solutions use the currently selected project as the startup project.

Uncheck that and see if the behavior changes.

Upvotes: 7

Related Questions