System.Runtime.InteropServices.COMException (0x80004005): 无法创建目录或文件

 下单员QQ远程求助,百试不得解
调试时出错信息:
自定义工具错误: "代码生成器 'ReportCodeGenerator' 失败。异常堆积 = CrystalDecisions.Shared.CrystalReportsException: 加载报表失败。 ---> System.Runtime.InteropServices.COMException (0x80004005): 无法创建目录或文件。    在 CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   在 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   在 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- 内部异常堆栈跟踪的结尾 ---
   在 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   在 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   在 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
   在 CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath)
   在 CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator.GenerateCode(String inputFileName, String inputFileContent)" 
...................

现象:
System.Runtime.InteropServices.COMException (0x80004005): 无法创建目录或文件_第1张图片
原因:
临时文件目录下的空间不足,水晶报表出错。
解决方法:
将C:\Documents and Settings\Administrator\Local Settings\Temp目录下的文件删除掉就OK了。

感谢在挨踢界的同行们的支持,谢谢!

你可能感兴趣的:(C#经验/实例)