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

前端 未结 9 560
执笔经年
执笔经年 2020-11-30 05:46

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

相关标签:
9条回答
  • 2020-11-30 06:06

    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)
    0 讨论(0)
  • 2020-11-30 06:06

    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
    
    0 讨论(0)
  • 2020-11-30 06:08

    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.

    0 讨论(0)
提交回复
热议问题