This project is read-only.
2
Vote

RegisterType does not behave as expected when called twice

description

It appears that if you use RegisterType<TTo, TTFrom> to register a mapping with Injected Property parameters and then call it again without, the previous BuildPlan is not cleared.

The issue in more detail and unit test can be found on stackoverflow

http://stackoverflow.com/questions/30618988/why-does-unity-registertypetfrom-tto-not-re-register-mappings-correctly

I feel this is a pretty serious issue.

If it is deemed to be 'as designed' then please could you add a way to remove Registrations/BuildPlans manually, I see no reason why ClearExistingBuildPlan is private, if it was protected I could subclass the container and fix this.

comments