Unable to launch Visual Studio 2015 as a different user - visual-studio

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.
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?

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.

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.

Related

After Visual Studio 2015 installation, hard drives seem to be locked

I have a Windows 2012 system with Visual Studio 2010 installed. It worked fine on this system. Today I installed Visual Studio 2015 Community Edition on it. After installation, when I try to open existing solutions with Visual Studio 2010, the loading becomes very slow. Also, I am not able to save any modified files in the solutions. It seems that all the solution folders and files have become read-only. When I tried to change the attribute in Explorer, I was shown "You will need to provide administrator persmissions to change these attributes", even though I already logged in as administrator.
When I tried to save an ordinary text file, I was also not able to because some process is locking it. The same thing happens to C:\ as well.
Also, I notice that if I right click and select "New" from the pop-up menu in Explorer, the only option is "Folder" (this only happens for D:\ and not C:).
What could be the problem?
The local security policy was changed when I installed Visual Studio 2015 Community Edition. In Security Settings -> Local Policies -> Security Options, "User Account Control: Run all administrators in Admin Approval Mode" was changed to "Enabled". All I needed to do was to change it back to "Disabled" and then restart the system. The problems described disappeared after that.

another instance of an application is already in process - visual studio 2013

I am attempting to log into Microsoft Visual Studio, so I can connect to TFS, and I am unable to login.
After I enter my credentials, it acts like everything is good to go but I do not login in the top right. When I hover over Sign in I get an error stating "Another instance of the application is already in the process of signing in."
I did just remove my user settings because of another issue not allowing me to actually connect to anything because I just branched a product.
I have attempted to shutdown the computer, restart visual Studio, reinstall visual studio and I also reinstalled microsoft office; as well as. added the two sites mentioned from another forum to my trusted sites (*.accesscontrol.windows.net)(https://app.vsaex.visualstudio.com/me?mkt=en-US). if anyone has any information on this that would be greatly appreciated. Thank You
Just try below things to narrow down the VS sign in issue:
Disable any Anti-Virus or Anti-Spyware software on your
computer, navigate to <Visual Studio Installation Path>\Common7\IDE
and run the following commands: devenv.exe /resetuserdata, it will
take a couple of minutes to run as Visual Studio cleans up and sets
itself back to its original state.
Close visual studio --> delete the following registry key
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon\ConnectedUser\IdeUserV2
--> restart visual studio --> Try and sign in
Remove credenticals from Credential Manager (Control Panel\All
Control Panel Items\Credential Manager)
Clean VS caches:
Close Visual Studio (ensure devenv.exe is not present in the Task
Manager)
Delete the %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache directory
Restart Visual Studio.
Open the following file in notepad:
C:\windows\system32\drivers\etc\hosts
Add
65.52.55.39 and app.vsspsext.visualstudio.com then re-open vs and try the sign in again.
However it's not necessary to sing in Visual Studio if you just want to connect to TFS. You can only manage the connections in Team Explorer. When you add a new TFS server and try to connect, it will prompt to enter the credetical. Just enter the appropriate TFS credentical to connect the TFS server.

TFS 2012 + Visual studio 2012: some settings options return "The user name or password is incorrect"

I've upgraded our TFS 2010 to TFS 2012 without any issues. I can connect to the source control, checkin, everything I need to Work.
But if I go to the settings page for the team project I'm connected to, the following options work as expected:
Team project: Source Control
Team project: Portal settings
Team Project Collection: Source Control
Team Project Collection: Process Template Manager
But the rest of the options on the settings page just gives me this error
I've tried looking at the requests Visual Studio makes to the TFS server using Fiddler, and with the ones that don't work, no requests are actually being made to the server. So it seems like the server is never being contacted for those specific options.
I've tested this on two independent installations of Visual studio 2012, runnning on Windows 8.
EDIT
I just installed VS2010 SP1 on one of the machines, and I can just fine access all of the following settings options: Security, Group Membership, Areas and Iterations, Portal Settings and Source Control.
Looks like a VS2012 issue of some sort.
We resolved our issue with this by running VS 2012 with our domain credentials. We use VMs for development, so we do not directly login into the domain. To run VS, we use the following (as a batch file):
runas /netonly /user: username "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"
where username is your domain credential.
It sounds like the code is still using some values that are cached on the client after the upgrade. How long ago was it that you upgraded the server?
To test whether that is it, rename your cache folder (with VS 2012 closed) and launch VS 2012 again so it recreates the cache from scratch.
C:\Users\\AppData\Local\Microsoft\Team Foundation\4.0

Need to debug process as a non admin (VS2010)

I am running the following
Win7 SP1 Enterprise
VS2010 Pro SP1
Non admin user
I need to attach to the w3wp.exe process
I have assigned myself debug privs via GPO
When attempting to attach to the process I get
Microsoft Visual Studio
Unable to attach to the process. Visual Studio has insufficient privileges to debug this process. To debug this process, Visual Studio must be run as an administrator.
The main issue is I need to debug a site that handles multiple hostheaders (sitecore)
Cassini has no concept of hostheaders
IISExpress does not handle hostheaders - cannot launch site with different hostheaders*
Is there an alternative around this ?
Side note
I have tried to give myself admin token with the following as a test as well
http://www.scriptlogic.com/products/privilegeauthority/
VS launches as an 'admin' but gives me the whole Unable to attach to the process. Visual Studio has insufficient privileges to debug this process.
Side note 2
Using process explorer on devenv.exe doesn't show the SeDebugPrivilege enabled
I have tried using ntrights.exe to grant the rights - rebooted and still not there.
If you have an admin password you can (when you open VS) right click, and then say 'run as administrator', otherwise you just may be out of luck as far as I know.
This link here: Working with Web Projects in Visual Studio as a Non-Administrative User says it clearly:
You cannot attach to a process that is running under the IIS worker
process because it requires administrative privileges.
We ended up using http://www.scriptlogic.com/products/privilegeauthority/ granting the SeDebug Token as well.
This worked out well as we could also apply this to other products like ants profiler which needed admin rights to run (wasn't required for XP)

Debug or build as non-admin in Visual Studio 2008

I am trying to install Visual Studio 2008 at a university's computer lab. The lab machines (XP Pro) are configured so that students don't have Administrator rights when they log in. So when I try to build or debug a class library project in Visual Studio 2008, I get this error: "Cannot register assembly 'C:\Documents and Settings(username)\My Documents\Visual Studio 2008\Projects\testproj\testproj\bin\Debug\testproj.dll' - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\test.cmdTest' is denied."
In previous versions of Visual Studio, there was the option to add the non-admin account to the Debugger Users and VS Developers groups, and this would enable them to debug and build DLLs. Does Visual Studio 2008 include similar functionality, and would this even be the solution? I'm not seeing the groups added with the installation. If this functionality is not included, is there another way to solve this issue? Allowing students to have Admin rights or Power User rights to the machines is out of the question.
Any suggestions, ideas, or insight would be much appreciated.
Why not just consider using some kind of virtualizations ? Install Visual Studio on a virtual machine, hence, every mess a student gonna make, is gonna be virtual to some extent.
Keep a ready and fresh copy of the image file though.
Probably not the answer you want, but you could start VS by right clicking VS2008/devenv.exe > "run as" and select administrator and have the lab tech enter the admin credentials. This way, VS2008 will have the required rights, but your school isn't giving out a sensitive Login/Password.
Your school should change the group policy to allow you to build your projects. Enlist the help of a friendly professor for that.
Are you doing a web application? I believe that for non-web applications, you do not need admin rights.
If this is not a web application, maybe it's just a file system permissions issue?
From:
http://msdn.microsoft.com/en-us/library/ms165100.aspx
"User permission requirements for Visual Studio vary depending on the operating system and the Visual Studio version. On Windows Vista, Visual Studio 2008 does not require administrator permissions to perform most tasks, but Visual Studio 2005 must run under administrator permissions to perform tasks correctly. On Windows Server 2003 and earlier, members of the Users group can perform most activities in the integrated development environment (IDE)."
It looks like you're trying to register the assembly in COM.
Access to the registry key
'HKEY_CLASSES_ROOT\test.cmdTest' is
denied."
Are you setting a [assembly:ComVisibleAttribute(true)] attribute in your assemblyinfo.cs or project properties? Try setting this to assembly:ComVisibleAttribute(false).

Resources