Unable to open the StoreFront console, error “MMC has detected an error in a snap-in and will unload it”

Unable to open the StoreFront console, error “MMC has detected an error in a snap-in and will unload it”

book

Article ID: CTX319101

calendar_today

Updated On:

Description

•    The customer is unable to open the StoreFront Store console in one StoreFront (SF) server
•    When opening the console, he gets the option to view stores or create new stores
•    If clicking on Server group on the left menu, he can see the member servers with no problems
•    When clicking ‘View Stores’ or clicking ‘Stores’ in the left menu, the console closes out with no error
•    Sometimes he gets an error “MMC has detected an error in a snap-in and will unload it”
•    After clicking OK in the error popup, a new error comes up saying ‘unhandled Exception in Managed Code Snap-in’
•    Now the SF console says ‘Snap in Unavailable’
•    If looking at the event viewer in the SF server we can see the following event:

Event ID: 1
An error occurred running the command: 'Get-DSIsWindowsFeatureInstalled' The given key was not present in the dictionary. At C:\Program Files\Citrix\Receiver StoreFront\Management\Cmdlets\UtilsModule.psm1:1177 char:16 + $feature = Get-WindowsFeature $featureName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The given key was not present in the dictionary


•    Trying to reinstall the SF software, it errors out
•    Running PowerShell command  <get-windowsfeature>, gives error: “The given key was not present in the dictionary”

Resolution

•    When running the PowerShell command <get-windowsfeature> in Windows Server 2012, the error “get-windowsfeature : The given key was not present in the dictionary” may come up
•    This seems to occur if there is a problem in the registry key ‘ServerComponentCache’ under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\ServicingStorage\
•    As this is just a cache registry key you can try renaming it to ‘ServerComponentCache.old’ and run the PowerShell command again or refreshing the view in server manager.

Problem Cause

A corrupt Windows registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\ServicingStorage\ServerComponentCache’ was triggering the ‘The given key was not present in the dictionary’ error

Additional Information

http://david-homer.blogspot.com/2013/07/get-windowsfeature-given-key-was-not.html