This happens because KeyValuePair<TKey, TValue> does not define a custom == operator and is not included in the predefined list of value types that can use it.
Here is a link to the MSDN documentation for that operator.
For predefined value types, the equality operator (==) returns true if the values of its operands are equal, false otherwise.
Your best bet for an equality check in this case, because this is not a struct you have control over, is to call default(KeyValuePair<TKey,TValue>).Equals(pair) instead.