Finally, I found a workaround. In the class, RetryTurndefine an internal property Guid UniqueIdand initialize it with the new value Guidin the default constructor:
public class RetryTurnElement : ConfigurationElement
{
public RetryTurnElement()
{
UniqueId = Guid.NewGuid();
}
internal Guid UniqueId { get; set; }
...
}
RetryTurnCollection GetElementKey :
public class RetryTurnCollection : ConfigurationElementCollection
{
protected override object GetElementKey(ConfigurationElement element)
{
return ((RetryTurnElement)element).UniqueId;
}
...
}