Mariano Desanze
Mariano Desanze

Reputation: 8163

Visual Studio files association in Windows

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).

Upvotes: 9

Views: 12703

Answers (3)

nathanchere
nathanchere

Reputation: 8098

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

Upvotes: 8

Lord_Curdin
Lord_Curdin

Reputation: 954

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

Upvotes: 2

Mariano Desanze
Mariano Desanze

Reputation: 8163

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.

Upvotes: 7

Related Questions