Free Support Forum -

Aspose.Network.Outlook.Pst.FolderInfo.HasSubFolders throws KeyNotFoundException

I am using Aspose.Network version 6.8 to read messages from a PST. I am using code similar to that found in the online examples in the recursive "DisplayFolderContents" snippet. It is throwing a KeyNotFoundException:

System.Collections.Generic.KeyNotFoundException was caught
Message=The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.SortedList`2.get_Item(TKey key)
at Aspose.Network.Outlook.Pst.FolderInfo.get_HasSubFolders()

Please see the attached screenshot from Visual Studio -- it shows the values in the 'folderInfo' object immediately before the exception is thrown. You can see a breakpoint on the line "if (folderInfo.HasSubFolders)", and if I F10 to step over that line, it throws the exception. It occurs on the "Calendar" folder.

Can this be addressed in the next release? Thank you!

Best regards,
Rob v

I surrounded the line "if (folderInfo.HasSubFolders)" with a try/catch block, and found that the same error is thrown on each the following folders:

Conversation Action Settings
Junk E-mail
RSS Feeds
Sent Items
Sync Issues
Recoverable Items

Thank you,


Hi Rob,

Thank you for inquiry.

Does this problem occurs with just specific PST file or any other PSTs as well?

I tried to read several PST files at my end, but could not reproduce this issue with any of these. Is it possible for you to send your PST to us for analysis?

You may zip/upload on Banckle and share the link using “Contact” --> “send saqib.razzaq an email” button on this thread.

Unfortunately I am unable to upload the file. For one thing, it is 400 MB in size, but more importantly, it belongs to a client with whom I have an NDA. That is the reason I attached a screenshot, to help you see what was happening.


Please make a copy of this PST file, open it in Outlook, delete all the confidential emails and then try loading with Aspose.Network to see if it still throws exception? If yes, then you may send this copy to us.