9

In order to limit my own destructive powers, I have two domain accounts, one for normal work and one for TFS admin stuff. For years I have been using the Run as different user feature for opening another Visual Studio window as my admin account whenever I need to do admin stuff. Both users is members of the local administrator group.

About a month ago this stopped working resulting in the below dialog instead of launching Visual Studio. Both option does nothing - no Visual Studio launches. The suggested link http://go.microsoft.com/fwlink/?LinkId=659046, refer to older Visual Studio versions: 2005, 2008 and 2010. I have Visual Studio 2015 Update 3 installed with the latest cumulative servicing update.

enter image description here

I have a feeling that it started after I installed Windows 10 1607 (Anniversary Update) - before I had Windows 10 1511, but I am not sure that something else caused the change. It is possible to open a command prompt as but admin user, but launching Visual Studio from here results in the same dialog. I have tried on another machine with 1607 with same result, and I can still get it to work on a machine with 1511. I have also tried with another user, but again the result is the same.

A workaround is using the Switch User feature of Windows but this makes it impossible to have a window e.g. Outlook open as my normal user switching back and forth.

Any suggestion on how to get around this?

Tore Østergaard
  • 4,362
  • 3
  • 27
  • 43
  • 1
    I'm unsure what the solution is here, but if you open a command prompt as the visual studio user, can you run visual studio from there? I accept this isn't ideal (and is no full solution), but may offer a short term fix until the main problem is fixed? (Edit: Also, have you tried creating another user for Visual Studio to test with to see if it's not a user account "weird-ism"?) – jonifen Sep 19 '16 at 09:34
  • Good suggestion with the command prompt, but unfortunately the same happens. I have also tried with another user who sees the same. I will add this info to the question. – Tore Østergaard Sep 19 '16 at 10:17

2 Answers2

15

Try to run Visual Studio using this command instead:

runas /netonly /user:<account> devenv.exe

This should be enough to have Visual Studio under a context of another Windows user so it can connect to remote TFS with different credentials.

I'm running the SQL Server Management Studio as different user this way so I can manage remote SQL servers from different Windows domains.

PS: I tried to run Visual Studio 2015 Update 3 on Windows 10 version 1607 as different Windows account (standard user account without admin rights) and I got the same warning about the admin rights.

Jozef Izso
  • 1,740
  • 15
  • 22
  • Your solution wierdly works! There seems to be a difference in shift+right-click as apposed running the command. I would have thought that the shift+right-click would just be a shortcut for the command line. – Tore Østergaard Sep 26 '16 at 07:22
  • 2
    The `netonly` may be a clue here... It's possible the local user profile cannot be loaded or created. Which is circumvented by loading the process in a context which basically only changes the outgoing server connection's user properties. – jessehouwing Sep 29 '16 at 12:34
  • While this /netonly option works, the drawback is that the password isn't checked. – SBF Aug 30 '17 at 09:13
  • 1
    This answer is amazing. However to run this command, either the current directory on command prompt must be the location where the devenv.exe file is located or we must give full path. – Merin Nakarmi Mar 21 '18 at 17:54
-3

I have a tried solution which works for me which is I just make the run-as user account to the local administrators group of the computer you are running it from.

  • 1
    And a solution for people that tend to forget their latchkey is to leave their front door open? ;P – Jan B. Feb 02 '17 at 00:50