customers
重複した顧客を見つけようとしているList(of String) があります。
If Not customers.Count = customers.Distinct.ToList.Count Then
customers = customers.Except(customers.Distinct.ToList)
End If
しかし、次の例外が発生します。
InvalidCastException Unable to cast object of type '<ExceptIterator>d__99`1[System.String]' to type
'System.Collections.Generic.List`1[System.String]'.
これは、リスト内の重複を見つける正しい方法ですか?