Access to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers denied

Topics: For TFSAdmin Developers, For TFSAdmin Users, TFSAdmin FAQ
Feb 16, 2010 at 8:18 AM
Edited Feb 16, 2010 at 8:27 AM

I start the TFS Administration tool 2.0 Beta  by using Run as... .

I do so because the userid to access the server is different from the userid with which I am logged on to the PC  I am using.

I then do not get access to the above mentioned registry key.

What to do?

16/02/2010 09:05:57: TFS Admin Tool application started
16/02/2010 09:05:59: Button clicked: Server Explorer CONNECT
16/02/2010 09:05:59: Exception occurred
                       Type: System.UnauthorizedAccessException
                       Message: Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers' is denied.
                       InnerException: -
                       Source: mscorlib
                       Target: Void Win32Error(Int32, System.String)
                       Stacktrace:    at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
   at Microsoft.TeamFoundation.Client.RegisteredServers.OpenCurrentUser(Boolean writable, Boolean shouldCreate)
   at Microsoft.TeamFoundation.Client.RegisteredServers.GetServerNames()
   at Microsoft.TeamFoundation.Client.RegisteredServers.GetServers()
   at Microsoft.TeamFoundation.Proxy.DomainProjectPickerInternal.FillServerList()
   at Microsoft.TeamFoundation.Proxy.DomainProjectPickerInternal..ctor(DomainProjectPickerMode mode, String helpTopic)
   at Microsoft.TeamFoundation.Proxy.DomainProjectPicker..ctor(DomainProjectPickerMode mode)
   at TFSAdministrationTool.Controllers.MainController.OnServerConnect() in D:\Work\TFS Admin Tool\Main\src\TFSAdministrationTool\Controllers\MainController.cs:line 32
   at TFSAdministrationTool.mainForm.serverConnectToolStripButton_Click(Object sender, EventArgs e) in D:\Work\TFS Admin Tool\Main\src\TFSAdministrationTool\MainForm.cs:line 88

Coordinator
Feb 17, 2010 at 8:46 AM

Does your userid that you use to access the server have any permissions locally on the PC?

Can you try logging in locally with the userid that you use the access the server and try to start the tool?

Thanks, Ladislau

Feb 17, 2010 at 9:07 AM

I have logged in on the PC with the userid that has access to the server, but I get the same result.

The userid which has access to the server is not allowed to access the registrykey.

A solution would perhaps be to have the possibility to choose a userid/password to connect to the server, different from the userid currently logged on to the PC.

 

Coordinator
Feb 17, 2010 at 10:22 AM

Something seems very wrong with the local permissions of your userid which has access to the server. I find it very strange the a logged in user cannot modify its own HKEY_CURRENT_USER hive. The exception is actually by the connect dialog which comes with the Team Foundation Server object model and which is used by Visual Studio as well. Could you please try to log in locally with the userid that has access to the server, open Visual Studio and try to connect to the server and see if you are getting the same error.

You should use Process Monitor to better understand which registry permissions are missing and correct them. Let me know how it goes.

Thanks, Ladislau

Coordinator
Feb 17, 2010 at 2:02 PM

To parrot Ladislau, that is strange. You should see the same results when you log in with the same user on the PC and try to connect to that TFS instance with Visual Studio. If you don't get that result then that is even more interesting. If you do get that same error then I'd think checking the permissions on that registry key is next up to see what it is set at and why.

 

Thinking outloud on if there could be some sort of Group Policy getting in the way.

Feb 17, 2010 at 2:02 PM

Ladislau,

Thank you for putting me on track for the solution.
Starting VS local with the server-userid made VS crash and not start up.
I removed the profile from the local PC and started fresh.
The userid was added again and now I CAN RunAs the TFS AdministrationTool 2.0Beta..

Thanks again.

Harry

Coordinator
Feb 17, 2010 at 2:04 PM

Excellent. Ladislau is always on the right track. :-)

Coordinator
Feb 17, 2010 at 3:28 PM

Harry,

Glad I could help. Let us know if you run into any issues with the tool or if you have any feature requests.

Thanks, Ladislau