AnsweredAssumed Answered

Error iterating ExtendedProperties

Question asked by JamesPD on Aug 22, 2019
Latest reply on Aug 22, 2019 by David Hearn

Hi there, 


I am encountering an intermittent issue with the ExtendedProperties of Event Frames.  The AFSDK version is 2.10.5, although I've seen the same issue on other versions of the AFSDK also.  The exception looks like this when it occurs:


System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at OSIsoft.AF.Asset.AFExtendedProperties.get_KeyValues()
at OSIsoft.AF.Asset.AFExtendedProperties.System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.GetEnumerator()


The line of code that induces the issue is as follows:


foreach (KeyValuePair<string, object> efKvPair in ef.ExtendedProperties)


Any ideas what could be causing this?  Nothing seems obviously wrong with the Event Frames when viewed in PI System Explorer.