Failure during generic comparison: the type '{0}' does not implement the System.IComparable interface. This error may be ...

Failure during generic comparison: the type '{0}' does not implement the System.IComparable interface. This error may be arise from the use of a function such as 'compare', 'max' or 'min' or a data structure such as 'Set' or 'Map' whose keys contain instances of this type.