My problem is that I have an ASP.Net application with crystal reports in it. I have to store the Crystal report’s ReportDocument object in the session state, which is an unmanaged resource.
My question is: Will the ReportDocument object be disposed off on Session.Abandon or I will have to manually do it myself, and if I have to manually remove the ReportDocument object from the session state. What process should I follow, because at the Session_End event I would not know, what was the name of the object that was stored in SessionState, neither will be able to identify the Key with which the ReportDocument object is stored in the Session.
Please help…
I believe that when you store the object in the session you are simply serialising a copy of the objects current state, this copy won’t be holding onto any unmanaged resources, but the original object will and you can just dispose of that after you have saved it to the session.
EDIT
Alternatively store all your reports in one session object that is a collection with a single key. e.g. List reports