卸载AppDomain时出错。 (HRESULT异常:0x80131015)

时间:2012-09-29 18:39:10

标签: c#

使用ReportViewer后出现此错误。退出时出现此错误。不知道是什么原因引起的。我正在使用C#。

1 个答案:

答案 0 :(得分:16)

这是一个reported Microsoft错误。有一种解决方法 - 在关闭父窗体之前调用reportViewer.LocalReport.ReleaseSandboxAppDomain()方法。

示例:

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

参考:Weird behaviour when I open a reportviewer in WPF