开发者

Weird behaviour when I open a reportviewer in WPF

开发者 https://www.devze.com 2023-03-30 21:08 出处:网络
When I open a report in my WPF project once, I get this message this message when I exit {\"Error while unloading appdomain. (Exception from HRESULT: 0x80131015)\"}

When I open a report in my WPF project once, I get this message this message when I exit

{"Error while unloading appdomain. (Exception from HRESULT: 0x80131015)"}

Stack Trace :

at System.AppDomain.Unload(AppDomain domain)
at Microsoft.ReportingServices.RefCountedAppDomain.Dispose()
at Microsoft.Reporting.WinForms.LocalReport.ReportRuntimeSetupHandler.ReleaseSandboxAppDomain()


at Microsoft.Reporting.WinForms.LocalReport.Dispose()
at Microsoft.Reporting.WinForms.ReportInfo.Dispose()
at Microsoft.Reporting.WinForms.ReportHierarchy.Clear()
at Microso开发者_开发知识库ft.Reporting.WinForms.ReportViewer.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()

Is there something I do wrong ? I just open a form with a windowsFormHost and a ReportViewer inside. Do I need to close something else before closing my application ?


This is reported microsoft bug. However, there is a workaround for it - The workaround is to call

reportViewer.LocalReport.ReleaseSandboxAppDomain();

method before closing the parent form.

example :

private void frmMyForm_FormClosing(object sender, FormClosingEventArgs e)
{
            reportViewer1.LocalReport.ReleaseSandboxAppDomain();

}

You can look at here for any assitance : http://connect.microsoft.com/VisualStudio/feedback/details/522208/wpf-app-with-reportviewer-gets-error-while-unloading-appdomain-exception-on-termination

0

精彩评论

暂无评论...
验证码 换一张
取 消