1st i’m newbie
I import object/Class using lazy()
now my questions are
1) what is the lifetime of my object?
2) how this object disposes?
3) if Disposed manually can MEF later reinitialize it when i issue object.value?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally the lifetime of the object is the same as the lifetime of the container, and it is disposed with the container. The lifetime/disposal can happen earlier in some situations for NonShared parts. Here is an answer that goes into more detail on MEF part lifetime.
For your third question, the answer is no. Depending on what you’re trying to do, ExportFactory might be what you’re looking for. It will let you create and dispose multiple copies of a given export.