We went into similar ideas on MEF. The fact that it has an Export<> class almost enable your code snippet. We do have a ReleaseExport on the container
var export = container.GetExport<IService>(); var service = export.GetExportedObject(); service.DoSomething(); container.ReleaseExport(export); // or if you have the guts: (service as IDisposable).Dispose(); On Wed, Mar 4, 2009 at 1:36 PM, Bill Barry <[email protected]> wrote: > The generated proxies can be written in such a way that if the object is > disposed of in the finalizer instead of being explicitly disposed, an > exception could be thrown (at least I hope this could be possible while > the program is running in debug mode). You cannot throw on finalizer. That can kill the finalizer thread. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en -~----------~----~----~----~------~----~------~--~---
