grokky
grokky

Reputation: 9265

Open file in existing instance of Visual Studio 2017

I used to be able to open a file in an existing instance of VS - devenv.exe had a /dde switch for that.

But with VS2017 it opens the file in a new instance, not the one already running.

For example for json files:

But that /dde is ignored.

Maybe all the betas and RCs corrupted something. My VS2017 is the latest updated version.

Does the /dde switch still work?

Upvotes: 4

Views: 2517

Answers (2)

SHi
SHi

Reputation: 29

I had the same problem with visual studio 2019 and windows 11. I thought manipulating the registry was overkill, so I looked for a workaround.

Just create a .bat file with the following contents and select that .bat file from "Select Another Program".

start "" "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" /edit %1

Upvotes: 2

grokky
grokky

Reputation: 9265

Okay what was missing was these:

  • HKEY_CLASSES_ROOT\VisualStudio.json\shell\Open\ddeexec\ with a default value of Open("%1").

  • HKEY_CLASSES_ROOT\VisualStudio.json\shell\Open\ddeexec\Application\ with a default value of VisualStudio.15.0

  • HKEY_CLASSES_ROOT\VisualStudio.json\shell\Open\ddeexec\Topic\ with a default value of system

All VS related files follow this pattern.

Upvotes: 2

Related Questions