1

I created a GIT repository on GitHub, then created a TFS Project with Git scm and Agile process template, then I chose Import Repository and specified the GitHub URL.

After the TFS Project was created I see an error message in Team Explorer:

Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0_8708a912\WorkItemTracking\TeamMenu\AddWorkItemMru\TFSServer01\XYZProjectCollection\64c06df7-220f-433c-b7d6-6a59426340e1' is denied.

I get a msgbox with the same error when I try to create work items.

The symptom of the problem is not the root cause; the registry key doesn't even exist so i cant give permission to it: enter image description here

I saw this related QA but clearing TFS and VS cache dont help.

I ran a ProcessMonitor trace while reproducing the problem and I see the ACCESS DENIED but it points to another REGISTRY A??

enter image description here

So its misleading that it was Denied Access to the Registry Key HKEY_Current_User. But what is this REGISTRY\A and where is it located? When I use ProcessMonitor JumpTo it cant find the location in the registry and ends up at Computer\HKEY_CLASSES_ROOT\Software\Microsoft\Windows

Does anyone know how I can give myself permission to this REGISTRY\A?

Note: I am the TFS Admin and an admin of this PC. I've read up on REGISTRY\A and Application Hives I just dont know how to give myself access. Also, the GitHub repository was empty when imported to TFS, if that makes a difference. This is an on-premise install of TFS2017 on an Azure server in a VPC.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
  • Did you run your VS with admin mode? What's the result if you do this? – PatrickLu-MSFT May 26 '17 at 06:04
  • I get the same error when run VS as Admin and try to create Work Item. I ran ProcMon again and there is no difference this time with Admin. Any other ideas much appreciated Patrick. fyi Creating Queries and other things work in the TFS Project and that's encouraging that it is narrowed down to WI's only. – Jeremy Thompson May 26 '17 at 06:12
  • If this is only related to workitem creating, you could go through your user/ group permission if there is some deny settings which related to **Edit work items in this node** . To check this please follow https://stackoverflow.com/questions/3919341/what-permissions-are-needed-to-add-edit-work-items-in-tfs For TFS2017 you could find this in your project - work - areas -area- right click security - user/group's permission... – PatrickLu-MSFT May 26 '17 at 06:26
  • What's the version of your Visual Studio? From VS 15, when you open/create work item from team explorer, it will open web browser by default, which should not access to registry. Did you change the behavior from settings? – Eddie Chen - MSFT May 26 '17 at 06:31
  • Something really fickle is happening. I visited the security tab and could see I'm an Admin but couldn't find the **Edit work items in this node**. I didn't change anything but decided to create a bug inn VS Team Explorer and it worked! I tried to create another bug and it failed with the error. Huh, wtf? So I close the 1st Bug window and created another Bug - it works. So seems like I cant have an Open WI. I then try to create a Task and it fails. Eh, I decide to try in Web TFS Portal to try and create a Task, it works, I go back to VS and create a Task it works. – Jeremy Thompson May 26 '17 at 06:40
  • I will try to diagnose the root cause of this and get back to you guys as I think a Visual KB SOX would be good to cover this unique error. @Eddie Yes, I have the Option to open Wi's inside Visual Studio... the plot thickens. Thanks for your help so far. – Jeremy Thompson May 26 '17 at 06:41
  • The answer I post [here](https://stackoverflow.com/a/46430423/6485536 ) worked for me when resolving this. – OraDotNetDev Sep 26 '17 at 16:26
  • @OraDotNetDev - you could just as easily open VS as Admin. fyi I added an answer to that thread as a colleague just experienced that specific error connecting to a TFS Project. – Jeremy Thompson Sep 27 '17 at 01:39

1 Answers1

1

To edit a Application Hive. Ref: Access Visual Studio 2017's private registry hive

This key appears to be stored in VS application hive file:

C:\Users\<user name>\AppData\Local\Microsoft\VisualStudio\15.0_05fc10d7\privateregistry.bin

Start regedit as admin, load the hive file (privateregistry.user.bin) into regedit :

  1. Launch RegEdit.exe
  2. Select the Computer\HKEY_LOCAL_MACHINE node in the left-hand pane
  3. Select the File | Load Hive... menu item, and load the privateregistry.user.bin
  4. When prompted for a key name, just type in something like "VSRegHive"
  5. This will load the data into a VSRegHive under the HKLM node
  6. To fix the problem either create the missing keys or edit existing ones

  7. When finished select the VSRegHive and select File | Unload Hive... , before exiting the RegEdit.exe utility, otherwise VS will fail to start. Keeping the hive loaded in regedit creates some sort of lock that prevents DevEnv.exe from launching.

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