I’m currently debugging some custom workflow activities and updating the logging code so it produces more useful information (apparently my ‘development’ error codes aren’t human readable enough!) and noticed that I was getting lots of ‘KeyNotFound’ exceptions in the event log.
Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other —> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
After much digging through my code I spotted that this was actually being generated whenever I read from FIM in the Portal and while it was a relief to know that my workflow code was off the hook I didn’t really want to leave this in place and cluttering up the eventlog.
It looks like this was introduced during one of the hotfix releases (4.1.3496 is mentioned in the article I’ve linked to below) when additional Portal configuration was introduced to allow the Advanced Search option to be turned off – this means that my local FIM installation was actually attempting to locate an attribute on the Portal Configuration that I didn’t have in my schema which was the cause of the KeyNotFound exceptions I was finding.
The steps to fix is are fairly simple as follows (Steps taken from the referenced documents – not my own work – see below for links)
To enable the configuration and remove the Advanced Search link, follow these steps:
- In Administration, click Schema Management, and then click All Attributes.
- Create a new Boolean attribute that is named “HideAdvancedSearchLink.”
- In All Bindings, create a new binding for the HideAdvancedSearchLink attribute to the Portal Configuration resource, and then click Finish to save the binding.
- Create a new Management Policy Rule (MPR) to allow for changes to the new binding in the portal configuration. To do this, use the following configuration for the new MPR:Display Name: Administrators can modify the HideAdvancedSearchLink attribute in the Portal Configuration resource
Specific Set of Requestors: All Administrators
Operation: Modify a single-valued attribute
Permissions: Grants permission
Target Resource Definition Before Request: All Basic Configuration Objects
Target Resource Definition After Request: All Basic Configuration Objects
Resource Attributes: Select specific attributes: HideAdvancedSearchLink
- Reset Internet Information Services (IIS), and then restart the FIM service.
- In Administration, click Portal Configuration, and then click Extended Attributes. You should see theHideAdvancedSearchLink attribute together with the other extended attributes.
- Click to select the HideAdvancedSearchLink check box, and then click Submit to enable the hiding of the Advanced Search link.
- Verify that the Advanced Search link is not available in the list views. For example, check the following list views:
- My DGs
- My DG Memberships
- Management Policy Rules
Once I had this implemented and FIM restarted the errors were removed and I was left with the exceptions of my own making again – yay I think!
Links for the above are to: