Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
本文介绍了在WPF中打开报表查看器时出现奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在WPF项目中打开报表一次时,退出时收到以下消息
{"Error while unloading appdomain. (Exception from HRESULT: 0x80131015)"}
堆栈跟踪:
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 Microsoft.Reporting.WinForms.ReportViewer.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()
我是不是做错了什么?我只是打开了一个内部带有windowsFormHost和ReportViewer的窗体。在关闭应用程序之前,我是否需要关闭其他内容?
推荐答案
这是报告的microsoft错误。但是,有一种解决方法- 解决方法是调用
reportViewer.LocalReport.ReleaseSandboxAppDomain();
关闭父窗体之前的方法。
示例:
private void frmMyForm_FormClosing(object sender, FormClosingEventArgs e)
{
reportViewer1.LocalReport.ReleaseSandboxAppDomain();
}
您可以在此处查看任何关联: http://connect.microsoft.com/VisualStudio/feedback/details/522208/wpf-app-with-reportviewer-gets-error-while-unloading-appdomain-exception-on-termination
这篇关于在WPF中打开报表查看器时出现奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:在WPF中打开报表查看器时出现奇怪的行为


猜你喜欢
- 带问号的 nvarchar 列结果 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- 使用 rss + c# 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01