4

I have always been able to drag source code files into the Visual Studio editor to open them. This is very convenient but lately it no longer works.

I thought the issue was my upgrading to VS2017 but after reading several similar questions here on Stack Overflow, I understand that the issue is probably that I'm running Visual Studio 2017 in Admin mode but since explorer is not run in admin mode Windows 10 apparently prevents dragging files from one user account to another to be opened via drag and drop.

That's all well and good. But the solution outlined here Drag & Drop files into Visual Studio doesn't work involves control panel UI for Windows 8 and that don't exist in the same place in Windows 10 and I can't seem to find them anywhere in Windows 10.

Another similar question, Visual Studio does not let me drag drop items into it? has an accepted answer of installing VS Commands for VS 2012 which provides features to deal with the issue. But when I search online I'm unable to find a similar download for VS 2017.

Another highly upvoted answer to that same questions suggests running cmd.exe as administrator then running explorer.exe from there. The thought being that when explorer.exe is ran this way it will be ran as administrator and then drag and drop to VS 2017 running as administrator should work. But I tried this and alas, it still doesn't work to drag a file (in my case AppSettings.json) into VS2017 from this special explorer window and have it open. Using a tip from one of the answers below, used task manager to see if this approach resulted in explorer.exe running with elevated privs and it did not.

All suggestions welcome.

RonC
  • 31,330
  • 19
  • 94
  • 139

1 Answers1

2

Use my workaround to be able to start Windows Explorer.exe as admin.

enter image description here

When you now start Explorer and Visual Studio as admin, you can drag & drop files.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • I was unable to do as the cited post suggested because I received an access denied error when saving. See cited post for more detailed comment. – RonC Sep 06 '17 at 15:21
  • 1
    take ownership of the reg key first and add full permissions to your user account. it works fine for me – magicandre1981 Sep 06 '17 at 15:26
  • That solved my issue. Using this approach when I run explorer.exe from a cmd.exe (running as admin) the explorer.exe now runs with elevated privs and this in turn allows files to be dragged from that explorer window into VS 2017 with VS2017 immediately opening them. It's crazy the work around is this complicated but I'm grateful to have something that works. – RonC Sep 06 '17 at 16:08
  • 1
    this is a known issue for 10 years. this is a side effect of the UAC which was added in Vista. – magicandre1981 Sep 06 '17 at 16:11