9

In Windows Explorer when I double-click on any Visual Studio file (*.cs, *.csproj, etc.), it's opening an old version of VS instead of the latest one (VS 2017). And VS has associations with too many file types.

How can I change the default Visual Studio (for all those files that VS can handle)?

There is a similar old question about Visual Studio 2008 (Move file associations from Visual Studio 2005 to 2008) but the solution in there doesn't work anymore (there is no "Restore File Associations" button on the settings of Visual Studio 2017).

Mariano Desanze
  • 7,847
  • 7
  • 46
  • 67

3 Answers3

8

Yet another in a long list of previously working-just-fine things which Microsoft have managed totally #$@%@ up. If I try to change defaults the 'right' way I get this kind of thing:

enter image description here

i.e. completely ignored. The only way I've managed to solve it is by removing the file association entirely through the registry. Let's take .asm as an example:

  1. Open Registry Editor / "regedit.exe"
  2. Navigate to HKEY_CLASSES_ROOT\.asm\OpenWithProgIds
  3. Delete any Visual Studio values you see

enter image description here

From there, you can (finally) open files with whatever you choose instead of having the association clamped to Visual Studio:

enter image description here

For the record, I believe this to be a problem with Windows 10. Not with Visual Studio. See: https://answers.microsoft.com/en-us/windows/forum/windows_10-files/cant-change-default-programs-in-windows-10/229fc3a9-25c9-433b-a333-5806bc5090db

nathanchere
  • 8,008
  • 15
  • 65
  • 86
  • 5
    Yes its broken in 1809, new windows association manager is a joke. Just tried for vs 2019. – rvnlord Apr 05 '19 at 15:06
  • It works perfectly fine for me as well as most people who use it. So clearly, the problem is your PC. If the problem was inherent to Windows, such that it doesn't work for anyone that uses it, what would rationally justify MS not fixing it? – XJDHDR Feb 13 '21 at 03:48
  • 1
    @XJDHDR have you looked at file associations in Windows 11? :P Not only is the problem inherent to Windows but Microsoft are still eager to make the user experience for anything remotely approaching 'power user' as painful as possible. – nathanchere Jan 19 '22 at 12:48
  • 1
    @XJDHDR _If the problem was inherent to Windows, such that it doesn't work for anyone that uses it, what would rationally justify MS not fixing it?_ Welcome, you must be new here ;) – Hugh W Mar 12 '23 at 12:16
  • @HughW You need to start thinking rationally. Your illogical Ipse Dixit, Ad Hominem, Straw Man and Moving the Goalpost fallacies don't answer my question. Again, why is it that only a fringe group has a problem with this if it was broken by design? Where is your proof that this problem has nothing to do with anything Nathan did to his own PC? – XJDHDR Mar 13 '23 at 18:33
  • @nathanchere You also need to start thinking rationally. Windows 11 hadn't even been announced (let alone released) when I posted my comment, so you are illogically Moving the Goalposts. Also, the instructions for changing default associations (such as https://winbuzzer.com/2022/04/13/how-to-change-a-default-app-or-file-association-in-windows-11-xcxwbt/) are virtually identical in Win 10 and 11, so more irrationality. Again, why is it that only a fringe group has a problem with this if it was broken by design? Where's proof that this problem was not caused by something you did to your own PC? – XJDHDR Mar 13 '23 at 18:43
7

Each version of Visual Studio registers itself in the Set Default Programs panel of the Control Panel. Go to Control Panel\Programs\Default Programs

"Default Programs"

Then choose Set Default Programs:

Default Visual Studio 2017

In there you can simply choose the Visual studio version of your choice and then click the button Set this program as default in order to associate every file type that VS handles.

Or you might prefer to click the button Choose defaults for this program to review the current associations of those file types and change only the ones you want.

Mariano Desanze
  • 7,847
  • 7
  • 46
  • 67
  • 4
    Current version of Windows 10 (1809 build 17763.1) redirects "Set Default Programs" to the new "improved" settings screen and no longer offers the option of resetting all associations, you have to do it one by one... – janv8000 Oct 16 '18 at 08:38
  • Just to update, VS 2019 and 2017 the same problem still ... had to do it manually the way described above. – Honza P. Nov 08 '19 at 08:19
2

On the file you will always open with vs17, click right and choose open with and there choose another app. On win10 it pop out a dialog with some proposals. If vs17 is there, choose your favorite and activate the always open with. then ok and your done. enter image description here

enter image description here

Lord_Curdin
  • 957
  • 1
  • 14
  • 27