问题
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:
- The Windows service keeps consuming memory an eventually OutOfMemoryException is thrown and process terminates
- 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?
来源:https://stackoverflow.com/questions/34763930/net-localreport-rdlc-appdomain-issues