问题
I have code that was previously adding ExtendedProperties to components like
component.ExtendedProperties( new { prop = someObject });
This method is no longer available and the constructor for Property is marked internal.
Is there a new way of doing this for v2.5?
Specifically, I have a custom ComponentActivator that needs some instance information at resolution time from the initial registration. I have been storing this information in the ExtendedProperties then retrieving it in the ComponentActivator constructor using
model.ExtendedProperties["prop"] as MyObjectType;
回答1:
This was never changed in .NET version, so I'm assuming you're talking about version for Silverlight.
This method will be back in version 2.5.1, however due to restrictive behavior of Silverlight runtime you will have to make internal types in your assembly visible to Castle.Core
.
Alternative way, that works across all versions is this:
component.ExtendedProperties( Property.ForKey("prop").Eq(someObject));
来源:https://stackoverflow.com/questions/3647595/castle-windsor-2-5-breaking-changes