Castle Windsor v2.5.0 Release Notes

Release Date: 2010-08-21 // over 13 years ago
    • 0️⃣ Typed Factories will not implicitly pick default ITypedFactoryComponentSelector registered in the container anymore
    • Obsoleted all the AddComponent* methods in favor of using Installers and fluent registration API
    • ServiceSelector delegate (used in WithService.Select calls) changed signature to fix a bug: http://3.ly/eP5Q
    • 🚚 moved IWindsorInstaller to Castle.MicroKernel.Registration namespace
    • 🚀 typed factories will now obey container release policy, that is if the container does not track the component, so won't the factory.
    • ➕ added helper methods to fluently configure logging facility using: container.AddFacility( f = > f.Fluent().Magic().Here() );
    • ➕ added overload for UsingFactoryMethod which exposees ComponentModel of component to the factory
    • ➕ added generic overloads for ITypeConverter.PerformConversion to reduce casting.
    • 👕 it is now possible to call WithService.Foo().WithService.Bar() and both services will be used. Also more methods were added: WithService.Self() and WithService.AllInterfaces()
    • ➕ added simple debugger visualizer to help diagnosing misconfigured components.
    • ➕ added optimized mode to StartableFacility for Single-call-to-Install scenario that won't start anything before the end of Install (at which point the container is assumed to be completely configured and all components should be there) and it will throw if it can't resolve and start the component.
    • ➕ added OptimizeDependencyResolution around calls to Install
    • Component.IsInNamespace and its sister methods have now overload that let you include components from subnamespaces as well.
    • ➕ added ability to load assemblies from designated directory (with fair bit of optional filtering using new AssemblyFilter class). It works in three places:
      • AllTypes.FromAssemblyInDirectory() - picks assemblies for registration
      • FromAssembly.InDirectory() - installs installers from assemblies in the directory
      • - installs installers from assemblies in directory via XML
    • 🔧 TypedFactoryFacility - added ability to configure factory inline: Component.For().AsFactory(f => f.SelectedWith("selectorKey"))
    • 🔄 Changed IModelInterceptorSelector's signature and behavior (see breakingChanges.txt for details)
    • ✂ removed IProxyHook interface (see breakingchanges.txt)
    • ➕ added support for specifying typed factory component selectors on a per-factory basis
    • ➕ added support for using services as mixins
    • ➕ added autogenerated delegate-based factories. Taking dependency on Func and calling the delegate will return IFoo from the container
    • implemented IOC-ISSUE-203 - Add to fluent API scanning assemblies for IWindsorInstallers and installing them
    • ➕ added fluent API for EventWiringFacility
    • ➕ added ability to specify assemblies that will be scanned for types when shorthened type name is using via XML using the following syntax:
    • ➕ added ability to specify installers (IWindsorInstaller) via XML using either of the following: installers must be public and have default constructor.
    • Xml config does not require assembly qualified type name any more - specifying just type name, or typename+namespace should be enough. Works only for types in already loaded assemblies.
    • ResolveAll will now resolve components that are not in Valid state when inline/dynamic arguments are provided
    • TypedFactoryFacility: TypedFactoryComponent will now fallback to resolving by type if no component with designated name can be found
    • 🛠 fixed issue with per-web-request components not being released properly in some cases
    • 🛠 fixed IOC-ISSUE-199 - NamingPartsSubSystem broken when RegisterHandlerForwarding is used
    • TypedFactoryFacility: added ability to resolve multiple components
    • TypedFactoryFacility: added ability to put custom resolving logic
    • 🛠 fixed another case of IoC-168 where a component with two constructors of different parameter length couldn't be resolved when the fewer parameter constructor was not satisfied
    • If and Unless functions on fluent registration API are now cumulative - it is legal to call them multiple times and all conditions will be checked. This is a minor breaking change from previous behavior where last call would win.
    • ➕ added typed arguments (specified by type rather than by name). It works for:
      • call site (Resolve with Dictionary, specifying System.Type as value of key. A helper class 'Arguments' should be used for this.)
      • DynamicParameters - there's an extension method Insert that should make using it nicer
      • fluent Api (DependsOn(Property.ForKey().Eq("typed"))
    • ➕ added 'Insert' extension method on IDictionary, specifically so simplify usage in DynamicParameters method and similar situations. It behaves like IDictionary's indexer setter
    • ➕ added 'Arguments' class to carry inline arguments (typed or named) for components. It is recommended to use this class rather than Hashtable or Dictionary<>
    • ➕ added strongly typed overloads for StartUsingMethod and StopUsingMethod from startable facility's registration API. It is now possible to call .StartUsingMethod(x => x.Start).StopUsingMethod(x => x.Stop)
    • 🚚 moved StartUsingMethod/StopUsingMethod to extension methods in StartableFacility's namespace. Startable() method was removed as superfluous.
    • 🔄 changed the UsingFactoryMethod (and UsingFactory) methods in fluent registration API to not rely on FactorySupportFacility. They now work even if facility is not used.
    • 🛠 fixed IOC-ISSUE-190 - "Resolve with argumentsAsAnonymousType overload is now case sensitive". This fixed a regression bug introduced in v2.1, and brings the behavior back to what it was in v2.0.
    • ➕ added support for specifying interceptorsSelector, proxyHook and mixins from config (see new tests for example). This also means some small impact breaking changes:
      • DefaultProxyFactory.CreateProxyGenerationOptionsFrom protected method has changed signature - it now also takes IKernel and CreationContext, to be used by IReferences to do resolve (see below)
      • DefaultProxyFactory.CustomizeProxy protected virtual method has changed signature, for the same reason as above
      • ProxyOption's properties changed types: Selector, from IInterceptorSelector to IReference Hook from IProxyHook to IReference MixIns from object[] to IEnumerable> IReference abstraction allows to use components resolved from the container, similar to InterceptorReferences.
    • 🚚 Moved several types from Core: ComponentActivatorAttribute ComponentProxyBehaviorAttribute CustomLifestyleAttribute DoNotWireAttribute
      InterceptorAttribute
      LifestyleAttribute PooledAttribute TransientAttribute GraphNode IVertex IRecyclable IStartable ComponentModel ConstructorCandidate ConstructorCandidateCollection DependencyModel DependencyModelCollection InterceptorReference InterceptorReferenceCollection LifecycleStepCollection MethodMetaModel MethodMetaModelCollection ParameterModel ParameterModelCollection PropertySet PropertySetCollection TopologicalSortAlgo IOnBehalfAware GraphSets GraphTestCase