System.IO.IOException: The file exists


In our 1.1 application, we are using of ASPOSE.PDF (a job that has been in production for over a year). Now, in our pdf.BindXML statement, we are getting a system crash with the following. System.IO.IOException: The file exists.

I have no idea what this error message is telling me. As I said, this application has been generating pdf files for well over a year with no problems.

Thanks, Mark

******* stack trace below **********

System.IO.IOException: The file exists.

Stack Trace:

IOException: The file exists.

Aspose.Pdf.Pdf.BindXML(String xmlFile,String xslFile) +107

al.a.(XmlDocument A_Q, XslTransform A_1) +26

System..IO.Path.GetTempFileName() +90

System.IO.___Error.WinIOError(Int32 errorcode, String str) +723


Dear Mark,

Thank you for considering Aspose.

That old version uses temp files. The GetTempFileName() is used to get the unique temp file name. Usually the file name should not be existed but it seems there is some problem. You'd better upgrade to the latest version of Aspose.Pdf in which temp file is not used. If you don't want to upgrade, you can delete all the temp file of the system.


Thank you.

1. How does the product know what folder to write the temp file into? I didnt see in the app how it was being set, so my guess is that uses the same folder as the "final" output file. But I dont see any files in that folder that have names other than the final files name (in other word, so "temp" names, such as __123tmp.pdf

2. Could this also be an NTFS permissions issue?


We know the temp file folder and name by calling GetTempFileName() method. Usually the folder is "C:\Documents and Settings\username\Local Settings\Temp". This should not be permission issue since you have used for long time.


Its happening on the server - and I wouldnt be surprised if they installed a service pack or whatever that tighened it down. What is the username in c:\documents and settingsā€¦ that account runs under?


The username is the account in the system that your application used to run. You need to logon to the system with that account before running your application.