52

On Visual Studio 2019

When I double click or even focus on project, it open Edit project

For previous version, It just only expand the project structure

How to disable this feature ?

phuongnd
  • 1,229
  • 15
  • 33
  • 2
    It sounds like this behavior will be fixed soon, likely in an upcoming Preview: https://developercommunity.visualstudio.com/content/problem/450667/clicking-on-a-aspnet-core-project-in-solution-open.html (I submitted feedback for this too and got redirected to this existing issue) – Jimmy Apr 08 '19 at 07:51

4 Answers4

77

Visual Studio 2019 (version 16.0) introduced the ability to double click on SDK-style projects in Solution Explorer and having them open in the editor.

Based on feedback, an option has been added in Visual Studio 16.1 (currently in preview) that restores the previous behaviour.

enter image description here

If you prefer the old behaviour, uncheck this setting.

EDITORIAL: SDK-style projects are very readable and easy to edit by hand. If you use SDK projects you may start to think of project files as regular source file and that double clicking to edit makes sense. Of course you may not, but it's worth considering.

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
  • Well that can't quite come soon enough, can it? :) Glad to see it is on it's way. – Fooberichu May 16 '19 at 23:35
  • 4
    Didn't work. The right solution is the option "Preview selected files in Solution Explorer" like in the answer of @Sajeetharan – Steffen Mangold Aug 06 '19 at 11:14
  • 1
    @SteffenMangold The OP asked about "double-click or even focus". This solves the double-click but not the focus. The other answer solves the focus/selection but not the double-click. – pbristow Oct 07 '19 at 17:18
  • 1
    VS 16.11.11 here: this option got renamed to "Open project files with double-click or the Enter key when supported". – Vanity Slug - codidact.com Apr 12 '22 at 13:55
8

Here the answer of @Sajeetharan again with a screenshot for a direct way to the setting that currently can be used as a workaround since the accepted answer is not working.

Of course this disables the preview from selected files in the Solution Explorer completely.

Visual Studio 2019 16.3.1:

enter image description here

Malte
  • 1,937
  • 1
  • 15
  • 20
6

Yes with VS2019, it is implemented the same way. There is a suggestion opened here

As of now there is no direct way to disable.You can click on the arrow to expand and see the files and structure

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • I'm running VS 2019 16.0.3 and I can't edit the project. When I double click it just collapse/expand! I have never edited any settings and I really wanted to open the famous edit window – Luishg May 09 '19 at 04:44
  • 1
    This should be the real answer, because the correct setting is "Preview selected files in Solution Explorer" – Steffen Mangold Aug 06 '19 at 11:13
2

In Visual Studio 2022 you can do this as follows:

  1. Go to "Tools"
  2. Select "Options"
  3. Select "Project and Solutions"
  4. uncheck "Open project files with double-click or the Enter key when supported"

Screenshot for visual demonstration

freedomn-m
  • 27,664
  • 8
  • 35
  • 57
Munam Yousuf
  • 431
  • 1
  • 6
  • 17