Castle Windsor v2.5.1 Release Notes

Release Date: 2010-09-21 // over 13 years ago
    • ➕ added "Potential lifestyle mismatches" debugger view item, that will detect and list situations where Singleton depends on Transient or PerWebRequest component (which is usually a bug)
    • 🛠 fixed issue where forwarding main type would create additional, superfluous handler
    • 🚚 WebLogger/WebLoggerFactory was removed from Castle.Core so all references to that are removed from Windsor as well
    • obseleted UseSingleProxyInterface in preference over IProxyGenerationHook
    • 🛠 fixed IOC-220 Composite pattern with CollectionResolver should be properly supported without throwing "cycle detected" exception
    • 🛠 fixed IOC-218 Enable methods that take arguments as anonymous objects in Silverlight version. This works in SL, but requires [assembly: InternalsVisibleTo(Castle.Core.Internal.InternalsVisible.ToCastleCore)]
    • 🛠 fixed IOC-217 Enable ISupportInitialize support as lifecyclecle concern in Silverlight 4
    • implemented IOC-216 Make it possible to specify service overrides in DependsOn, either via Property, or ServiceOverride entry class
    • 0️⃣ implemented IOC-215 Hide obsolete members from IntelliSense (in basic view. By default in VB they won't be showed, but will in C# :( )
    • 🛠 fixed IOC-214 Missing bracket in obsolete warning text
    • implemented IOC-212 Add ability to make IProxyGenerationHooks and IInterceptoSelectors IOnBehalfAware
    • 🛠 fixed IOC-211 Resolve doesn't work with constructor's ref argument
    • 🛠 fixed IOC-210 Typed Factory Facility treats constructor dependency as non-optional if resolved as a TFF component
    • 🛠 fixed IOC-209 Bug in constructor selection when resolving - Windsor would pick unresolvable constructor
    • 👀 reverted back (to the way it was in v2.1) conditional registration of helper components used by TypedFactoryFacility as it would cause issues when used with nested containers (see the new test and thread "Typed Factories in sub Container (differences between 2.5 and 2.1)" on users group)
    • ➕ added framework information the assembly was built for to the AssemblyTitle attribute
    • 👌 improved how late bound types are displayed in debugger
    • 🛠 fixed bug where count of potentially misconfigured components would show invalid value
    • ➕ added raw handler access to default component view in debugger
    • 🔄 changed how status message is displayed for potentially misconfigured components so that an actual visualizer for strings can be used to view this potentially long piece of text

    💥 Breaking Changes:

    🔄 change - ILazyComponentLoader.Load now accepts a third argument for additional arguments. impact - medium 🛠 fixability - easy description - To allow maximum flexibility and usage with Resolve, any additional arguments are now passed to the lazy loader.

    🔄 change - LifecycleStepCollection class was removed. Instaed LifecycleConcernsCollection class was introduced. ILifecycleConcern has now two innerited interfaces for commission and decommission. LifecycleSteps property of ComponentModel was renamed to Lifecycle. LifecycleStepType type was removed. impact - medium 🛠 fixability - easy description - To improve strongly typed nature and decrease probability of mistake and improve general usability of the type LifecycleStepCollection was removed. In it place similar type was introduced - LifecycleConcernsCollection. Instead of using untyped Objects and enums it works with two new interfaces : ICommissionConcern and IDecommissionConcern. 🛠 fix - have your lifecycle steps implement one of the new lifecycle interfaces. Use appropriate overload of Add/AddFirst to add them.

    🔄 change - Typed Factories will not implicitly pick default ITypedFactoryComponentSelector registered in the container anymore impact - low 🛠 fixability - easy description - In version 2.1 where ITypedFactoryComponentSelectors were introduced, when you had a selector registered in the container that selector would be implicitly picked for every factory you had. Since the behavior of a selector tends to be fine grained and targetet for a specific factories, this behavior was removed. You have to explicitly associate the selector with a factory (using .AsFactory(f => f.SelectUsing("MySelector")); or via xml configuration) to override selection behavior. 🛠 fix - using either fluent API .AsFactory(f => f.SelectUsing("MySelector")), or XML configuration selector="${MySelector}" specify the selector explicitly for each of your factories.

    🔄 change - ServiceSelector delegate (used in WithService.Select calls) changed signature impact - low 🛠 fixability - easy description - To fix a bug which would occur if type implemented multiple closed version of base open generic interface the signature of the delegate was changed from public delegate IEnumerable ServiceSelector(Type type, Type baseType); to public delegate IEnumerable ServiceSelector(Type type, Type[] baseTypes); so that multiple base types are possible (they would be closed versions of the same open generic interface) 🛠 fix - depending on the scenario. You would either ignore it, or wrap your current method's body in foreach(var baseType in baseTypes)

    🔄 change - moved IWindsorInstaller to Castle.MicroKernel.Registration namespace impact - very low 🛠 fixability - easy description -In order to improve developer experience when writing installers the interface was moved so that Component and AllTypes entry types for registration are already in scope. 🛠 fix - add using Castle.MicroKernel.Registration directive.

    🔄 change - Added two new overloads to ITypeConverter.PerformConversion impact - very low 🛠 fixability - easy description - To reduce casting in the most common scenario where converted value is casted to the type it's been converted to, ITypeConverter.PerformConversion has now generic overloads for handling this case. 🛠 fix - If you're implementing ITypeConverter via AbstractTypeConverter you don't have to do anything as the base class will handle the conversion for you. Otherwise implement it like in AbstractTypeConverter.

    🔄 change - AddCustomComponent method were moved from IKernel to IKernelInternal interface impact - very low 🛠 fixability - easy description - This method constitute internally used contract of kernel and is not intended for external usage. As such it was moved to internal interface to declutter public interface of IKernel. 🛠 fix - You should not have been using this method so it should not affect you in any way. If you did, cast the IKernel to IKernelInternal to invoke the method.

    🔄 change - IModelInterceptorsSelector.SelectInterceptors method changed its signature and how it is used. impact - medium 🛠 fixability - medium description - To accomodate additional scenarios that were impossible (or hard to achieve with previous design the method now has additional parameter, an array of references to interceptors, which contains either default interceptors for the component, or interceptors selected by previous interceptors in line). Also, Windsor will now never call IModelInterceptorsSelector.SelectInterceptors without calling IModelInterceptorsSelector.HasInterceptors before it, or when the latter returns false. 🛠 fix - When adjusting your implementation remember that model's interceptors are the default value passed as methods second parameter, so you don't need to merge them again manually (otherwise they'll be invoked twice).

    🔄 change - CreateComponentActivator, RaiseHandlerRegistered, RaiseHandlersChanged and RegisterHandlerForwarding methods were moved from IKernel to IKernelInternal interface impact - very low 🛠 fixability - easy description - These methods constitute internally used contract of kernel and are not intended for external usage. As such they were moved to internal interface to declutter public interface of IKernel. 🛠 fix - You should not have been using these methods so it should not affect you in any way. If you did, cast the IKernel to IKernelInternal to invoke the methods.

    🔄 change - IProxyHook interface was removed impact - very low 🛠 fixability - easy 🔀 description - Since MicroKernel was merged with Windsor and now depends on DynamicProxy directly there's no need to provide additional abstraction on top of IProxyGenerationHook. 🛠 fix - Make types that were implementing IProxyHook to implement IProxyGenerationHook. Change all usages of IProxyHook to IProxyGenerationHook.

    🔄 change - AddInstallerConfiguration and GetComponents methods were added to IConfigurationStore. impact - very low 🛠 fixability - easy revision - 3bf716cc6fc218601dab92a6dd75fe269bcb63d0 🔧 description - To enable installers to be exposed via configuration the interface has been extended by addition of the two methods. 🛠 fix - Implement the methods accordingly to your situation.

    🔄 change - Multiple types were moved between namespaces impact - low 🛠 fixability - trivial revision - 3bf716cc6fc218601dab92a6dd75fe269bcb63d0 🚚 description - To improve the internal structure several types were moved to other namespaces. 🛠 fix - When compilation error occurs adjust namespace imports as suggested by Visual Studio

    🔄 change - Assembly Castle.MicroKernel.dll was merged into Castle.Windsor.dll impact - high 🛠 fixability - easy revision - 730b202b0ed23a6b42258a6ffd6a3e63f89501fc description - Since vast majority of users used Windsor, as opposed to bare MicroKernel it was decided it didn't make sense to maintain two containers. As result of that their assemblies were merged, as first step of integration between Windsor and MicroKernel. 🛠 fix - In your projects remove reference to Castle.MicroKernel.dll. If you weren't using Windsor add reference to Castle.Windsor.dll In all places where your were referencing types from Castle.MicroKernel.dll via string (like xml configuration when registering facilities, or section on your web.config) update references from Castle.MicroKernel to Castle.Windsor.

    🔄 change - ComponentRegistration<S>.Startable public method has been removed. ComponentRegistration<S>.StartUsingMethod public method was moved to extension method. ComponentRegistration<S>.StopUsingMethod public method was moved to extension method. impact - low 🛠 fixability - trivial revision - 6710 description - StartUsingMethod/StopUsingMethod belong to StartableFacility and do not make sense as part of generic API. Startable method was superfluous. 🛠 fix - Remove calls to Startable(). Import namespace Castle.Facilities.Startable to use StartUsingMethod and StopUsingMethod as extension methods.

    🔄 change - DefaultProxyFactory.CreateProxyGenerationOptionsFrom protected method and DefaultProxyFactory.CustomizeProxy protected virtual method have changed signature impact - very low 🛠 fixability - easy revision - 6691 description - the methods now also takes IKernel and CreationContext, to be used by IReferences to do resolution of components they reference 🛠 fix - pass required parameters to the methods.

    🔄 change - ProxyOption's properties changed types: Selector, from IInterceptorSelector to IReference Hook from IProxyHook to IReference MixIns from object[] to IEnumerable> impact - very low 🛠 fixability - easy revision - 6691 description - the properties now use IReferences instead of live objects to allow for resolution of their values from the container, as required in case of usage from xml. 🛠 fix - wherever used, adjust types appropriately. To obtain actual objects, use Resolve method.