We are accessing outlook through redemption DLL in c#.net. We are using various services like: importing contacts, calendar integration etc. Sometime we are getting exception from redemption COM like:
The file abc.ost is in use and cannot be accessed.
'MyApplication' exited without properly closing your Outlook data file
Could somebody help us to identify the root cause of this issue?
Exception details are mentioned below:
Exception1:
OutlookServices.OutlookService - System.Runtime.InteropServices.COMException (0x80040119): Error in IMAPISession.OpenEntry: MAPI_E_EXTENDED_ERROR
Error: 'MyApplication' exited without properly closing your Outlook data file 'C:\Users\abc\AppData\Local\Microsoft\Outlook\[email protected]'. 'MyApplication' must be restarted. If this error message recurs, contact support for 'MyApplication' for assistance.
at Interop.Redemption.IRDOSession.GetMessageFromID(String EntryIDMessage, Object EntryIDStore, Object Flags)
Exception2:
OutlookService - System.Runtime.InteropServices.COMException (0x8004011D): Error in IMAPISession::OpenMsgStore: MAPI_E_FAILONEPROVIDER
Error: The file C:\Users\abc\AppData\Local\Microsoft\Outlook\[email protected] - abc.ost is in use and cannot be accessed. Close any application that is using this file, and then try again. You might need to restart your computer.
at Interop.Redemption.IRDOSession.GetDefaultFolder(rdoDefaultFolders FolderType)