Castle Windsor 2.5 Breaking Changes

谁说胖子不能爱 提交于 2019-12-12 01:37:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!