.NET LocalReport / .rdlc AppDomain issues

2019-06-21 20:30发布

I'm using Microsoft.Reporting.WebForms.LocalReport and .rdlc Report files to generate .pdf:s. This is done in the background in a Windows Service (.NET 4.6, x64, VS2015).

I'm having two issues:

  1. The Windows service keeps consuming memory an eventually OutOfMemoryException is thrown and process terminates
  2. At one occation the entire WindowsSerivce terminated with UnhandledException despite everything being enclosed in a try-catch statement.

Now, I've read somewhere LocalReport under .NET 4 has changed to live in it's own AppDomain.

So, when using LocalReport:

  • Are you supposed to always call localReport.ReleaseSandboxAppDomain() after each and every localReport.Render()?
  • Do I have to do something to handle any exceptions that may occur in the LocalReport sandbox AppDomain?

0条回答
登录 后发表回答