Hi. I have a .Net 4.0 console app (VS 2010) that reads Lotus Notes emails and uses the Aspose.Words.dll (product version: 2011.04.30, file version 10.0.0.0) to save any Word file attachments it finds in the emails in a pdf format and then drop them into a temp folder location on the machine where it's running for the program to finish processing and send to a SQL table. This code is running on a VM that is running Windows 2008 R2 server. This is a Dev server and this functionality used to work up until sometime recently. The same code and same version of Aspose.Words.dll is working right now on our production server. I have verified that the Aspose.Words.dlls are identical in both our Prod and Dev environments. The error that I receive is:
"System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception." and it only occurs when I run the console app outside of Visual Studio (VS). The error does not get thrown inside VS. I have checked the permissions on the folder and they haven't changed. The console app runs as a Scheduled Task and the account that the task is running under has Full Control to the "temp" folder drop location on the box. I also process Excel file attachments using your Aspose.Cells.dll and that still works fine and drops them into this same temp folder. I tried multiple Word documents and I even created a brand new Word document to test with and all of them threw this error. I will attach the Word document to this post. I have Googled this over and over and have not found a scenario that even comes close to what I'm doing. I am completely puzzled by this and have spent two days fighting with it to try to figure it out. I'm beginning to wonder if a Security Update for Windows could be causing this problem. Please help! I have no clue what's causing this, so I don't know how to resolve it. Thank you!
Here is the snippet of code from the app that uses the Aspose.Words.Document.Save method: Again, this works inside VS but does not work anymore from outside of VS. And I'm running VS on the same machine where this code is deployed.
case "docx":
Pdf pdfDocxBanner = new Pdf();
Aspose.Pdf.Generator.Section secDocxBanner = pdfDocxBanner.Sections.Add();
secDocxBanner.Paragraphs.Add(new Text(filename));
pdfDocxBanner.Save(strPdfOutput + @"\temp\" + parser.ParseDateTimeStamp(_email) + intFileCounter.ToString() + ".pdf");
intFileCounter++;
Aspose.Words.Document docx = new Aspose.Words.Document(strPdfOutput + @"\temp\" + rootFilename + "docx");
docx.Save(strPdfOutput + @"\temp\" + parser.ParseDateTimeStamp(_email) + intFileCounter.ToString() + ".pdf", Aspose.Words.SaveFormat.Pdf);
docx = null;
return true;
And here is the full stack trace from my SQL logs:
System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at x59d6a4fc5007b7a4.xdcf47a8f1807f37c.x7012609bcdb39574(x3adba2572f6b9747 x672ff13faf031f3d)
at x4a820b097ff6c983.xfef22f4f866de8d2.xe406325e56f74b46(xdcf47a8f1807f37c x32eaf67d0ee57cb7, xdeb77ea37ad74c56 x1e972e751678e682)
at Aspose.Words.Document.xaef272a322936116(Int32 xbf13a47a02af0066)
at xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at Aspose.Words.Document.Save(String fileName, SaveFormat saveFormat)
at FGG.Integration.LoDER.AsposeUtils.AsposeUtilities.ConvertAttachment(EmailItemsObject _email, String filename, Int32& intFileCounter, String strPdfOutput)
at FGG.Integration.LoDER.DominoAccess.ProcessAttachments(EmailItemsObject _email)
at FGG.Integration.LoDER.DominoAccess.ProcessDominoEmails(String DBType, String DBTitle, String DominoMailServer, String MailServerPath, String MailLocalPath, NotesDatabase nDbMailReplica, DdmemailRetrieverEntity derEnt)