You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extensions are implemented as types derived from UnityContainerExtension. Once extension is added to the container it is kept alive until container is disposed.
Some extensions provide custom configuration that could be modified during execution, but for majority of extensions, there is nothing else to do after method Initialize has been called.
The reason these extensions are kept in the container is because type UnityContainerExtension implements interface IUnityContainerExtensionConfigurator. The container assumes that each installed extension has configuration as well so it keeps it in the list.
Remove IUnityContainerExtensionConfigurator
To separate extensions that provide configuration or should be kept in the container from extensions that could be discarded, class UnityContainerExtension will no longer derive from IUnityContainerExtensionConfigurator. Only extensions that provide custom configuration or require to be kept alive will implement the interface.
Extensions that do not implement it, will be released immediately after method Initialize is called.
Remove method UnityContainerExtension.Remove() as redundant
Starting with v5.x, the container no longer allows removing installed extensions. This method is no longer being used and could be removed from the UnityContainerExtension type.
UnityContainerExtension
The revised UnityContainerExtension type should look as following:
Activity
Optimizing extension management
[-]Optimization of UnityContainerExtension[/-][+]UnityContainerExtension optimization[/+]