Feb 7, 2009 at 10:37 PM

I've found that method RemoveAllExtension() does not clear a BuildPlanStrategies (StrategyChain).
Accordingly at use of the extensions these strategies turn out doubled and IL too. 
In my opinion it is a bug.

Sorry, for my english.

Feb 9, 2009 at 7:52 PM
Your opinion is correct - it is a bug. Thanks for bringing it to our attention!

Until the real fix is in, you can either edit the source of the RemoveAllExtensions method and recompile, or write a small extension of your own that clears out that strategy list.

Feb 9, 2009 at 10:15 PM

I think it will be better to add methods in StagedStrategyChain<TStageEnum> for their association and removal (Merge and UnMerge). 
And UnityContainerExtension should have the StagedStrategyChain<TStageEnum> which it can easy remove if the given Extension leaves from the container. 
Then there will be no problems with duplicates of strategies. After all strategy can be added and from other Extension.

Example (not thread safe):


public class UnityExtension : UnityContainerExtension
    private StagedStrategyChain<UnityBuildStage> strategies;
private StagedStrategyChain<UnityBuildStage> buildPlanStrategies;    


    protected override void Initialize()
    { ... }



    private void OnExtensionAdded(object sender, RegisterEventArgs e)



    public override void Remove()