menuDictionary.Add(parentMenuItem.Name, parentMenuItem);
An item with the same key has already been added"
Error is self explanatory. Either you have duplicate '
parentMenuItem.Name' or you are adding it twice.
You have a dictionary where key-value pairs are stored. Error tells that you are trying to re-add a key. In dictionary you can not add duplicate key to the dictionary.
Read:
MSDN: Dictionary(Of TKey, TValue) Class[
^]