Crystal Reports “The file exists” error

Using: Crystal reports runtime for .net

Error: The file exists

StackTrace:  

in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath in System.IO.Path.InternalGetTempFileName(Boolean checkHost) in CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) in CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) in CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext) in CrystalDecisions.CrystalReports.Engine.ReportDocument.Export(ExportOptions options)

Solution:

This exceptions is documented in .NET and is  raised when the temp directory reach the limit of 65535 files.

Users/Administrator/AppData/Local/Temp
The directory was full of .tmp and .rpt files created from Crystal Report when is called the function ReportClass.Export(ExportOptions expOptions)
Cleaning the directory I’ve notice that many files was locked by the service from the last start.

Leave a reply:

Your email address will not be published.