The C# foreach statement and the Visual Basic For Each statement require the type of each element in the collection. Since each element of the IDictionary is a key/value pair, the element type is not the type of the key or the type of the value.