Can't open .sln files when under UAC in Vista - by ploeh

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 263221 Comments
Status Closed Workarounds
Type Bug Repros 8
Opened 3/13/2007 1:28:55 PM
Access Restriction Public


In Windows Vista, it's not possible to open a solution file (.sln) if Visual Studio is set to always run in Administrator mode.

As adviced in Visual Studio 2005 SP1 and the update for Windows Vista, Visual Studio should run in Administrator mode. As I'm a local Administrator on my PC, this shouldn't be a problem. On the other hand, I don't want to have to open the start menu, search for Visual Studio, right-click on it and select "Run As Administrator". That's not how I work.

This is how I usually work: I browse to a folder and select an .sln file and hit enter on my keyboard. Very rarely do I use the mouse. In Vista, the default behavior is that VS then opens the solution in non-privileged mode, but I want it to always open in elevated mode: If I'm writing code, I know what I'm doing!

For that reason, I've modified the properties of devenv.exe by setting the "Run As Administrator" check mark in the Compatibility tab. This ought to ensure (I hope) that VS always runs in elevated mode.

However, after I've done this, nothing happens when I hit enter on a .sln file. Visual Studio never opens. Double-clicking doesn't work either.
Sign in to post a comment.
Posted by __Sam__ on 4/9/2014 at 8:49 AM
I have this problem too. What's confusing is that I've been using it for a few weeks without any issues. No Windows Updates were installed, I didn't change any settings, I don't know why it stopped working. The only thing I did was modify one project file and added include paths, I didn't even modify the solution. To fix the problem I tried 1) changing the encoding to UTF-8 (it was already UTF-8), 2) setting VSLauncher.exe to always run as an administrator, and 3) installing all current windows updates. I had already changed devenv.exe to always run as an administrator, as was advised by VS 2005 when I first installed the program, so I didn't need to try that fix.

I found a solution that works for me though: turning off the run as administrator setting to devenv.exe fixed the problem. Which is ironic because several people claimed this was the fix. I'm running Windows 7 with all Windows Updates up-to-date (April 9th, 2014).
Posted by Fabian Schmied on 5/3/2011 at 1:20 AM
With VS 2010 SP1, the VSLauncher workaround no longer seems to work (as already indicated by Tim Burris).
Posted by MrKeith on 3/10/2010 at 11:25 AM
I agree that this should be considered a bug, however the workaround of setting VSLauncher.exe to run as admin worked for me and I am running Windows 7 Enterprise. Isn't there a way to tell the UAC not to prompt for certain executables?
Posted by Tim Burris on 10/12/2009 at 3:56 PM
On Windows 7, with all VS hotfixes applied, the VSLauncher workarounds are inaccurate and ineffective

a) Applying the Run As Administrator compatibility setting has no effect
b) VSLauncher.exe.manifest exists standalone, not embedded in VSLauncher.exe, and does not specify a requestedExecutionLevel
d) If I add a trustInfo/requestedExecutionLevel to the manifest and run VSLauncher.exe, it tells me that the program requires elevation, but does not actually request elevation with a UAC prompt
Posted by Tim Burris on 10/12/2009 at 3:38 PM
Not good enough. This behavior may indeed be By Design; however this merely means the design has a bug rather than the implementation.
Posted by Shaker Shaker on 3/3/2009 at 12:27 PM
Steve solution can be simplified, just go to this folder %Program Files%\Common Files\microsoft shared\MSEnv\
right click vsluncher.exe --> properties
in the compatibility tab set it to run as administrator.

That's all, now you can double click .sln files and accept the request to run it as administrator, and vs2008 will open.

Posted by MooMF on 1/19/2009 at 5:11 AM
To launch from a .sln file, add an elevated shortcut to the "send to" (C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\SendTo) folder.

To launch, right-click the .sln file, select "Send To", and choose the VS shortcut you added.

It's not perfect, but at least makes .sln files a viable launch option again.

(Added to Workarounds)
Posted by dale6 on 9/26/2008 at 8:46 AM
This seems like a totally unacceptable situation. Not being able to double-click a .sln file to open it, and not even being able to drop the file on VS2008 is very frustrating. No matter what is said about this being by design, all security issues should have been settled if I manually open VS2008 and accept the UAC prompt. Now I am running VS in administrator mode so why can I not drop a .sln file on VS2008 to open it?
Posted by parleer on 3/11/2008 at 6:52 AM
When i first installed Windows 2008 and experienced this problem I found this post in attempt to Google my way out of the problem. I couldn't find the answer so I created my own. I changed the Manifest of VSLauncher.exe so that it always executes with an elevated trust level. This allowed me to double-click on .sln files and have them always open up in 'Administrator' mode so that I can debug without having to relaunch Visual Studio or open Visual Studio from a configured shortcut and then browse to my .sln file. Of course the trade-off is that whenever I double click a .sln I have to 'accept' the request for elevated trust. Not a big deal for me.

Here's the solution:

pushd "c:\program files (x86)\Common Files\microsoft shared\MSEnv\"

// backup VSLauncher.exe just in case
copy VSLauncher.exe VSLauncher.exe-original

// export the manifest
mt -intputresource:VSLauncher.exe -out:VSLauncher.exe.manifest-modified

// Now open the exported manifest and make the <requestedExecutionLevel> element read level="histestAvailale".
write VSLauncher.exe.manifest-modified

// Save the file, then import the new manifest into the VSLauncher.exe
mt -manifest VSLauncher.exe.manifest-modified -outputresource:VSLauncher.exe;#1

Posted by Steve Wilkinson on 7/24/2007 at 3:24 AM
This is an extremely annoying problem, personally the "Closed By Design" response is not good enough. To me it says yes there is a problem but we aren't going to fix it.

If you use VS day in day out you'd soon get sick and tired of having to open the IDE then browsing to the appropriate folder and selecting a solution.

Come on MS, how did this get missed in testing, please sort it out.
Posted by Microsoft on 3/30/2007 at 4:05 PM
Thanks for reporting this issue. Unfortunately this issue is By Design due to the way our VS launcher mechanism works. One thing you can do is modify the VS shortcut to launch as Administrator (via Shortcut -> Advanced tab instead of Compatibility tab), but that will not address the scenario of launching VS via the SLN file and having it run as Admin.


The Visual Studio IDE Team
Posted by Microsoft on 3/15/2007 at 8:58 PM
Thanks for your feedback.We have reproduced this bug on Visual Studio 2005 SP1 with the update for Windows Vista, and we are sending this bug to the appropriate group within the Visual Studio Product Team for triage and resolution.

Thank you,
Visual Studio Product Team.
Posted by Microsoft on 3/15/2007 at 6:56 PM
Thank you for your feedback. We are currently investigating. If this issue is urgent, please call support directly (see

Thank you,
Visual StudioS2005 Product Team