Visual Studio does not let me drag drop items into it?

Visual Studio-2010FileVisual Studio-2012Drag and-Drop

Visual Studio-2010 Problem Overview


Using Visual studio 2010 I got problems when double-clicking, for example a config file (*.config). Visual Studio would open but give me a error message about parameters. If I simple try to drag and drop a file that Visual Studio usually can read in to it, the icon will give me the "not possible icon"?

I have now installed Visual Studio 2012 and it has the same problem?!

This makes my work a lot harder, it should be easy to just drag & drop files into Visual Studio, but it's not so? Now I have to manually find the file with the file menu?

Please note, I have re-installed the computer before installing Visual Studio 2012.

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

On Windows Vista and newer Windows Explorer runs with medium integrity level. If you run Visual Studio as administrator (high integrity level) then for security reasons OS will disable drag and drop from Explorer to Visual Studio.

You can either run Visual Studio as normal user or you can install VSCommands for Visual Studio 2012 extension. It has several features that can help with this such as:

  • Elevated Windows Explorer - small tool which looks like Windows Explorer but runs with elevated permissions allowing Drag And Drop
  • Directory Explorer - tool window inside Visual Studio which again looks like Windows Explorer and allows Drag And Drop
  • Run Visual Studio with medium integrity - allows Drag And Drop from Windows Explorer, but you won't be able to attach to processes run by other users (e.g. IIS)

Solution 2 - Visual Studio-2010

If you run VS as administator, instead drag n drop, do copy (either ctrl+c, context menu "copy") the file selection in explorer and paste (ctrl+v, context menu) on selected node in VS

Solution 3 - Visual Studio-2010

This was driving me nuts. In my Visual Studio solution I have two Web Application which use IIS as web server so because of this I have to always start my Visual Studio in Administrator mode. After starting as Admin I wasn't able to drag and drop files from Explorer to Visual Studio.

Solution:
  1. Open Command Prompt as Administrator (Shortcut for Windows 8.1 is āŠž Win + X + A)
  2. Type "explorer" this would open Windows Explorer with Admin privileges.

CMD Admin

And now you should be able to drag and drop any file from explorer to Visual Studio

Drag n' Drop

Solution 4 - Visual Studio-2010

If you disable UAC completely you can drag & drop from anywhere again. To do this you can't use the slider in the Control Panel because that only brings the UAC level down to 1. Make this registry change, reboot, and you can again use your computer like god intended.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLUA"=dword:00000000

Solution 5 - Visual Studio-2010

I think the main goal of this question is how to add many folders and files to your project in a comfortable way. Drag and Drop files into your project is one solution, which fails under certain circumstances.

Another very easy way is:

  • Copy the new folders and files where you physically want them in your project
  • Open the project explorer in VS and click the button "Show all files"
  • All the folders and files, which are now not part of your project yet appear white
  • Select the the white folders or files, right-click and choose "Bind to project"
  • Done

This is also possible, if you run VS as admin.

Have some fun!

By the way: I found this question, because I had the same issue with drag and drop. I understand the security issues, but it is an annoying feature.

Solution 6 - Visual Studio-2010

I'm using this easiest approach. When you run Visual Studio in Administrator Mode. When you need to drag and drop, just press CTRL+O to open up a file browser within visual studio, and use that file browser as an Elevated Explorer to do your drag and drop.

Solution 7 - Visual Studio-2010

I had a similar problem but my issue was a bit different. I was trying to drag and drop a file from inside a zipped folder. Once I unzipped the folder drag & drop started working again.

Solution 8 - Visual Studio-2010

I had this problem as well because I was opening VS in admin mode and the file explorer by default is not in admin mode.

Ended up creating a PowerShell and bat script to start explorer in admin mode every time the computer start.

admin.bat file:

@ECHO OFF
PowerShell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"

admin.ps1 file:

taskkill /f /im explorer.exe
start-process explorer.exe

The files just have to be in the same folder. Doesn't matter what they are called. Run the .bat file to restart explorer in admin mode or just create a shortcut to the .bat file in the startup folder ;) the script and ps1 file can be hidden.

Solution 9 - Visual Studio-2010

On windows 8.1, change the registry key: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA and set value = 0.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBansheeView Question on Stackoverflow
Solution 1 - Visual Studio-2010user503386View Answer on Stackoverflow
Solution 2 - Visual Studio-2010danielView Answer on Stackoverflow
Solution 3 - Visual Studio-2010nddView Answer on Stackoverflow
Solution 4 - Visual Studio-2010MikeView Answer on Stackoverflow
Solution 5 - Visual Studio-2010MichaelView Answer on Stackoverflow
Solution 6 - Visual Studio-2010Richie86View Answer on Stackoverflow
Solution 7 - Visual Studio-2010Andrej GroblerView Answer on Stackoverflow
Solution 8 - Visual Studio-2010stibayView Answer on Stackoverflow
Solution 9 - Visual Studio-2010MouradView Answer on Stackoverflow