开发者

Weird behaviour when I open a reportviewer in WPF

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜