none
Issue Creating temp files in Windows Forms control RRS feed

  • Question

  • I have an IE extension that uses ReportViewer Windows Forms control.It runs fine in Window XP and IE 7.When I run this in Windows Vista and IE running under protected mode I get errors.When I turn off the Protected mode off and run IE as Admistrator it works fine.The error I am getting is that Reportviewer is trying to create some temp files and it fails.Message I get is this "An unexpected error occured in report processing Could not find the part of the file path C:\Users\USERNAME\APPData\Microsoft\Windows\Temporaroy Internet files\virtualized\C:\Users\USERNAME\APPData\Local\temp\Low\lkpsw016.tmp".

    I think ReportViewer try to create some temp files but Protected Mode intercept their calls and try to create files on temp locations.But I don't know why it fails.As per http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx#dse_insse this should work fine without any code changes.

    Anyone else having similar issue or if anyone knows how to configrue report Viewer to create temp file at certain location.

    Here is the Exception

    ee the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'Main Report' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\WebUsabilityVista\AppData\Local\Microsoft\Windows\Temporary Internet Files\Virtualized\C\Users\WebUsabilityVista\AppData\Local\Temp\Low\pfamrfk7.tmp'.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
       at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
       at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)
       at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension)
       at System.CodeDom.Compiler.CodeCompiler.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
       at System.CodeDom.Compiler.CodeCompiler.FromDom(CompilerParameters options, CodeCompileUnit e)
       at System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDom(CompilerParameters options, CodeCompileUnit e)
       at Microsoft.ReportingServices.ReportProcessing.ReportCompileTime.InternalCompile(Report report, AppDomain compilationTempAppDomain, Boolean refusePermissions)
       at Microsoft.ReportingServices.ReportProcessing.ReportCompileTime.Compile(Report report, AppDomain compilationTempAppDomain, Boolean refusePermissions)
       at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.Phase3(ParameterInfoCollection& parameters, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
       at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
       at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileReport(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
       at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
       --- End of inner exception stack trace ---
       at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
       at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
       --- End of inner exception stack trace ---
       at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
       at Microsoft.Reporting.StandalonePreviewStore.StoredReport.CompileReport()
       at Microsoft.Reporting.StandalonePreviewStore.StoredReport.get_Snapshot()
       at Microsoft.Reporting.StandalonePreviewStore.GetCompiledReport(CatalogItemContext context, Boolean rebuild, ReportSnapshotBase& snapshot)
       at Microsoft.Reporting.LocalService.CompileReport(CatalogItemContext itemContext, Boolean rebuild)
       at Microsoft.Reporting.WinForms.LocalReport.CompileReport()
       --- End of inner exception stack trace ---
       at AccountInfoPluginNameSpace.AccountDetailReportForm.button1_Click(Object sender, EventArgs e) in C:\toolbar\plugin\AccountInfoPlugin\Source\Forms\AccountDetailReportForm.cs:line 315
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Thanks
    Guramrit

    Tuesday, July 7, 2009 11:25 AM