3

in VS 2017 when I connect to a Team Project in TFS 2013, I get an error:

Access to the Registry Key 'HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0\TeamFoundation\Instances\xxx' is denied.

The problem exists only in one of our two Team Project Collections after I reinstalled my workstation (Windows 7). My working account has no Admin privileges.

Mad by coding
  • 75
  • 2
  • 9

4 Answers4

1

First you could use another user account to connect the same team project to narrow down the issue.

If you got the same result. This should be a client side issue.Try to remove the TFS server in VS and clear TFS and VS cache. Re-add the server and connect to the team project again. You could also try to run VS with admin mode.

If another account could connect successfully. Suggest you to ask your TFS Admin to double check related permission for your account to connect the project in that specific team project collection.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Hi Patrick, thanks for your answer. I am the TFS Admin ;). The issue is when I use VS with an account withoud admin privileges. Would you suggest to run and work with vs under admin accounts in general? This is a long lasting discussion with our IT admin. – Mad by coding May 10 '17 at 11:03
  • @Madbycoding Usually we don't have to run VS in Admin mode by default when connecting to TFS server. Run and work with vs under admin accounts or not, it's based on your needs and company policy. [Why run Visual Studio as “Run as Administrator”?](http://stackoverflow.com/questions/20261724/why-run-visual-studio-as-run-as-administrator). In your case if run vs as admin could solve the issue. Suggest you to do it, since it's the simplest method available. Besides you could also clear the cache or reinstall the VS to see if you still need to run it as admin. – PatrickLu-MSFT May 10 '17 at 15:26
1

In some cases the error message is because the Registry Key is missing!!

This particular error refers to the Registry not VS2017's own special registry hive.


  1. Open the registry in Admin mode

  2. Start > type Regedt32 > right click Run As Admin.

  3. If the Instances Key doesn't exist, right click on TeamFoundation > Add Key > Instances.

enter image description here

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
0

There have been a number of on-going bugs for Visual Studio 2017 1 running on Windows 7. The workaround which worked for me was.

  1. Shutdown Visual Studio.
  2. Drop your user into the Local Administrators Group (Temporarily)
  3. Carry out the action which is throwing Unknown Error/Can't access Registry Key
  4. Shutdown Visual Studio and remove user from admin group.
  5. Carrying out the action now longer throws the error has

Access Denied error creating registry keys on Windows 7

  • Adding the entry into HKU by running as admin won't work as expected, as it will add the entry for the current user (ie the admin.) Though you could launch regedit as your current non-admin user. However this does not address the underlying this issue on Win7, which is an issue creating volatile registry keys. This results in the inability to configure diff tools, create custom work item queries, check solution properties, etc. Best practice is not to run elevated. Your configuration, workspace mappings and so on would be those of an admin-user not "you", hence the workaround. – OraDotNetDev Sep 27 '17 at 10:02
0

I have solved this problem with a tip from Jeremy Thompson.

  1. Open regedit (under your not admin account)
  2. Add the missing key Instances under teamFoundation

After that you can access TFS but I get another error about WorkItemtracking. There for you must add this Add key. For example: image

Now you don't need to start VS2017 under admin user.

cegas
  • 2,823
  • 3
  • 16
  • 16