The Domino interop API which is included with Lotus Notes causes an out of memory exception in .NET when the NotesDXLExporter class based object fails to export the 390th record, which is a big document, after exporting 389 records (which are smaller documents).
Here is a code snippet:
I initialize the NotesDXLExporter class.
NotesDXLExporter dxl1 = null;
I then configure the NotesDXLExported object as shown below:
dxl1 = notesSession.CreateDXLExporter(); dxl1.ExitOnFirstFatalError = false; dxl1.ConvertNotesbitmapsToGIF = true; dxl1.OutputDOCTYPE = false;
I then perform a for a loop shown below in reading documents using the dxl1 class (line on which exception occurs is indicated below).
NotesView vincr = database.GetView(@"(AllIssuesView)"); //view from an NSF file for (int i = 1; i < vincr.EntryCount; i++) { try {
vincrdoc = vincr.GetNthDocument(i); System.IO.File.WriteAllText(@"C:\Temp\" + i + @".txt", dxl1.Export(vincrdoc)); //OUT OF MEMORY EXCEPTION HAPPENS HERE WHEN READING A BIG DOCUMENT. } catch(Exception ex) { Console.WriteLine(ex); }
I have tried using a different version of the Interop domino dll and had had no success.
As I understand this, I see an API issue but I dont know if I am missing something?
Can you please shed some light on this?
Thanks in advance.
Subbu