I have a solution in which I spin up a service as a singleton instance. It inherits IDisposable
in order to properly flush and clean up internals. However, the Dispose
method is never called, because the StructureMap container itself is never disposed by Episerver.
I attempted to call IContainer.Dispose
from a IConfigurableModule.Uninitialize
method. But I cannot touch the IContainer
in any context other context than IConfigurableModule.ConfigureContainer
.
It would be very nice if you could make the IServiceConfigurationProvider
interface inherit from IDisposable
, and then explicitly dispose it on shutdown. Because then I would be able to remove my custom solution to this problem.