Rory Primrose has developed a Unity Extension that seems to do just that, as part of the Neovolve Tookit, and written multiple articles about it (http://www.neovolve.com/post/2010/06/18/Unity-Extension-For-Disposing-Build-Trees-On-TearDown.aspx). I would really love to see this integrated into Unity, as properly disposing the object graph is something a DI container should be able to do. Creating and disposing child containers feels inappropriate in design, and HierarchicalLifetimeManager prevents from using any other lifestyle.
Rory Primrose has developed a Unity Extension that seems to do just that, as part of the Neovolve Tookit, and written multiple articles about it (http://www.neovolve.com/post/2010/06/18/Unity-Extension-For-Disposing-Build-Trees-On-TearDown.aspx). I would really love to see this integrated into Unity, as properly disposing the object graph is something a DI container should be able to do. Creating and disposing child containers feels inappropriate in design, and HierarchicalLifetimeManager prevents from using any other lifestyle.