I know this problem has been fixed in later versions of Visual Studio. However, for some of us that are stuck in the old version of VS, this is a quick fix to see dictionary keys.
Say we have a dictionary called 'dict'. We need keys to see the meanings. Therefore, in the clock window, do the following:
dict.Keys.ToList()
This will allow you to turn around in the list and see the keys.
If you know the index of the key you want to make, follow these steps:
dict.Keys.ToList()[1]
This will display the key in index 1.
Now you can take this key and see what this value is with:
dict[dict.Keys.ToList()[1]]
Of course, you can replace the index with a list of keys with the actual key value in another viewing line, if that is easier.
EDIT: In addition, in the viewport you can also see dictionary entries with the following:
'dict.entries'
This will give you a list of entries to view. Each entry will have a property of "key" and "value".
source share