none
Debugging a drag drop application with UAC enabled RRS feed

  • Question

  • I'm working on an application that receives files from the user via file drag-drop. When running this from VS2008 for debugging, I encounter a problem with Windows 7 UAC (User Account Control). The UAC silently stops the drag-drop because the application is running under an elevated VSHOST application, and the explorer.exe which the files are beeing dragged from is not elevated.

    Does anyone have any tips on how I can debug drag-drop applications in Windows 7 without completely turning off UAC ? (I have set the UAC to the lowest level in the settings, but this doesn't help). I'm not comfortable by disabling UAC.

    I would think that this also could be a problem with other debugging scenarios, so MS should provide some sort of a workaround/fix for this?

    Thanks
    Tor-Odd Connelly
    Thursday, August 20, 2009 1:21 PM

Answers

  • Why don't you just run the D+D source app with elevated rights as well?  Disabling UAC is not going to destroy your machine instantly, pop the network cable if you really want to make sure.  Or disable the Visual Studio hosting process, the checkbox is on the Debug tab of the project properties.

    Hans Passant.
    Thursday, August 20, 2009 3:42 PM
    Moderator

All replies

  • Why don't you just run the D+D source app with elevated rights as well?  Disabling UAC is not going to destroy your machine instantly, pop the network cable if you really want to make sure.  Or disable the Visual Studio hosting process, the checkbox is on the Debug tab of the project properties.

    Hans Passant.
    Thursday, August 20, 2009 3:42 PM
    Moderator
  • The case is that I run VS2008 in elevated mode ("run as administrator") because it needs this for connecting to IIS etc, and the D+D source is explorer.exe which runs in non-elevated mode. D+D operations between elevated and non-elevated applications is an UAC violation.
    I also tried to disable vshost debugging, but this doesn't prevent the application from beeing started in elevated mode by VS2008.

    I know that disabling UAC isn't that dangerous (XP and earlier never had it) as long as I don't run unknown applications and such.
    I guess then that disabling UAC is the only option, but I was hoping that there was another solution.

    Tor-Odd Connelly
    Thursday, August 20, 2009 4:36 PM
  • You missed the 1st one I gave.  Run Explorer.exe elevated.  Make a shortcut, check "Run as administrator".
    Hans Passant.
    Thursday, August 20, 2009 4:44 PM
    Moderator
  • Well, I didn't actually miss it, I just thought that you couldn't/shouldn't run explorer.exe in elevated mode. Wouldn't that more or less criple the whole idea of UAC, since most user processes are beeing started from explorer.exe, and thus in effect this would be similair to disabling UAC?

    Or is it possible to start a second instance of explorer.exe with elevated rights? Maybe I will try this, but for now I just disabled UAC, and will take my chances :-)

    Anyway, thanks for your help


    Tor-Odd Connelly
    Thursday, August 20, 2009 4:58 PM
  • For those of us who use a company supplied machine, and who therefore cannot arbitrarily promote ourselves to administrator, is there any recommended solution to this sort of issue?  In particular, if I need to tell a tech support desk person how to fix the problem (since they can run as administrator) is there something which can be done to the applications to solve this for a user?
    Gardoglee
    Thursday, July 7, 2011 5:02 PM