We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PersonalStorage object in Memory

Is there a way to create an inMemory object of PersonalStorage type? I would like to open a .pst file from disk and load entirely into memory. Knowing that my .pst files can be up to and sometimes larger than 1GB I have plenty of memory to handle such an object. The need for this is to extract all the messages from the .pst file and process them individually doing some other work outside of the .pst file. This takes a very long time to extract 10K+ emails and when attempting to run in parallel for the IEnumrable<MessageInfo> list and extract from the same .pst file using the PersonalStorage object throws all sorts of different errors.
basic code snipet used is below.

pstStore = PersonalStorage.FromFile(PSTFileName);
FolderInfo folder = pstStore.RootFolder.GetSubFolder(“Inbox”);

var messages = folder.EnumerateMessages();
Parallel.ForEach(messages, po,(message) =>

MapiMessage msg = new MapiMessage();
msg = pstStore.ExtractMessage(message); //<-continues to fail due to locking of .pst instead of in memory object accessible by all threads at the same time (note: threads of 4 or more see this issue).


We have investigated your requirement and regret to share that what you are trying to achieve for loading PST in memory and using that for multi threading is not possible using Aspose.Email. The Aspose.Email API does not support multithreading while working with PST file. Also we have not plan to implement this feature.