.NET LocalReport / .rdlc AppDomain问题

Pop*_*ert 5 .net c# rdlc localreport appdomain

我正在使用Microsoft.Reporting.WebForms.LocalReport和.rdlc报告文件来生成.pdf:s。这是在Windows服务(.NET 4.6,x64,VS2015)中在后台完成的。

我有两个问题:

  1. Windows服务不断消耗内存,最终抛出OutOfMemoryException并且进程终止
  2. 一次,整个WindowsSerivce都以UnhandledException终止,尽管所有内容都包含在try-catch语句中。

现在,我读到了.NET 4下的LocalReport已更改为可以在其自己的AppDomain中使用。

因此,当使用LocalReport时:

  • 您是否应该始终在每个localReport.Render()之后调用localReport.ReleaseSandboxAppDomain()?
  • 我是否需要做一些事情来处理LocalReport沙箱AppDomain中可能发生的任何异常?