NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet · #653 most downloaded on NuGet
Castle Windsor is best of breed, mature Inversion of Control container available for .NET.
Last release 3 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 1.4 years
Most releases are documented
notes for 19 of 23 stable releases
Nothing withdrawn
no release was ever pulled
16 years old
26 releases · first in 2011
Added net6.0 ( @Jevonius , #630 )
net6.0 (@Jevonius, #630)Castle.Windsor.Extensions.DependencyInjection: Change Microsoft.Extensions.Logging dependencies to their abstract counterparts (@ikkentim, #626, #624)Castle.Windsor.Extensions.DependencyInjection: support parallel containers (@rvdginste, @generik0, #563, #577)Castle.Windsor.Extensions.DependencyInjection package to the Castle.Windsor.Extensions.Hosting package (@ikkentim, #625, #628)Castle.Facilities.Logging have been removed. Extensions methods for built-in logging factories have been added, however LogUsing<T> is still ideal. (@Jevonius, #636)
Castle.Facilities.Logging.LoggerImplementationCastle.Facilities.Logging.LoggingFacility(LoggerImplementation loggingApi)Castle.Facilities.Logging.LoggingFacility(LoggerImplementation loggingApi, string configFile)Castle.Facilities.Logging.LoggingFacility(string customLoggerFactory, string configFile)Castle.Facilities.Logging.LoggingFacility.LogUsing(LoggerImplementation loggingApi)Castle.Facilities.Logging.LoggingFacility.UseLog4Net()Castle.Facilities.Logging.LoggingFacility.UseLog4Net(string configFile)Castle.Facilities.Logging.LoggingFacility.UseNLog()Castle.Facilities.Logging.LoggingFacility.UseNLog(string configFile)One column per quarter.
Restrict Castle.Core dependency to 4.4.1+ and less than 5.x to prevent NuGet using 5.x which has breaking changes ( @Jevonius , #610 )
Upgrade minimum Castle.Core version to 4.4.1 ( @generik0 , #576 )
.NET Extensions' DependencyInjection:
.NET Extensions' DependencyInjection support via new Castle.Windsor.Extensions.DependencyInjection package ( @ltines , #517 )
Castle.Windsor.Extensions.DependencyInjection package (@ltines, #517)System.Nullable<> dependencies (@jnm2, #521)Fix ProxyOptions equality with additional interfaces ( @DamirAinullin , #477 )
ProxyOptions equality with additional interfaces (@DamirAinullin, #477)FrameworkDependencyResolver must not throw NRE if dependency has no type (e.g. depending on a named component) (@dariuslf, #489)__Generated__ in their name (e.g. TagHelpers generated for ViewComponents) as framework classes (@dariuslf, #489)Fixed first-chance HandlerException for optional parameters ( @jnm2 , #450 )
Removed deprecated classes AllTypes and AllTypesOf ( @Fir3pho3nixx , #338 )
TypeUtil.ToCSharpString (and hence in diagnostic messages) resemble C# more closely (@stakx, #404, #406)AllTypes and AllTypesOf (@Fir3pho3nixx, #338)BasedOn methods that reset registrations when fluently chained (@Fir3pho3nixx, #338)LifestyleHandlerType on CustomLifestyleAttribute (@Fir3pho3nixx, #338)WindsorContainer.Resolve(object/IDictionary) overloads in favour of new WindsorContainer.Resolve(Arguments)Arguments class, including to no longer implement IDictionaryIArgumentsComparer[] constructors from ArgumentsWindsorContainer.Resolve(IEnumerable<KeyValuePair<string, object>>) extension methodsCreationContext.AdditionalArguments to use Arguments instead of IDictionaryComponentDependencyRegistrationExtensions(Insert, InsertAnonymous, InsertTyped, InsertTypedCollection) with Add, AddNamed and AddTyped Arguments instance methodsComponentRegistration.DependsOn and ComponentRegistration.DynamicParameters to use Arguments via DynamicParametersDelegateComponentRegistration.DependsOn(Arguments) overloadComponentModel CustomDependencies and ExtendedProperties to use Arguments instead of IDictionaryIComponentModelBuilder.BuildModel to use Arguments instead of IDictionaryILazyComponentLoader.Load to use Arguments instead of IDictionaryFixed components resolved from typed factories being disposed along with unrelated objects ( @jnm2 , #439 )
Logging Facility's LoggerImplementation enum, UseLog4Net and UseNLog methods are deprecated in favour of LogUsing<T> , this includes the loggingApi pr…
System.ComponentModel.TypeConverter NuGet package by updating minimum Castle Core version to 4.1.0 (#321)LoggerImplementation enum, UseLog4Net and UseNLog methods are deprecated in favour of LogUsing<T>, this includes the loggingApi property for XML configuration (@jonorossi, #327)Remove .NET 3.5, .NET 4.0 and .NET 4.0 Client Profile support (@fir3pho3nixx, #173, #180, #177, #185)
Breaking Changes:
Enhancements:
Bugfixes:
Ldarg_N from LOCAL 0 to LOCAL [0,1] in OpCodes so test FluentRegistrationTestCase.Can_publish_events_via_AllTypes could publish events again on Windows 10 Home (build 14393.693) VS 2015 Update 3 using .NET 4.x (@fir3pho3nixx, #168)Fix case sensitivity issue that can cause UsingFactoryMethod to fail (@dohansen, #116)
implemented #57 - build NuGet and Zip packages from TeamCity - contributed by Blair Conrad (@blairconrad)
fixed IOC-349 - SerializationException - Type is not resolved for member "Castle.MicroKernel.Lifestyle.Scoped.CallContextLifetimeScope+SerializationRe
implemented IOC-375 - List duplicate registrations that are registered through convention
Breaking Changes:
change - the following methods were removed: IHandler IHandlerFactory.Create(ComponentModel model, bool isMetaHandler) IHandler IKernelInternal.AddCustomComponent(ComponentModel model, bool isMetaHandler) void IKernelInternal.RegisterHandler(String key, IHandler handler, bool skipRegistration) IHandler DefaultKernel.AddCustomComponent(ComponentModel model, bool isMetaHandler) the following methods were added: IHandler IKernelInternal.CreateHandler(ComponentModel model) void IKernelInternal.RaiseEventsOnHandlerCreated(IHandler handler) reason - In order to avoid potential deadlocks that were possible when the container was starting and certain combination of open generic components was involved the API was modified to allow limiting the scope of locking when using open generic components. issue - IOC-370 (http://issues.castleproject.org/issue/IOC-370) fix - the changes occur in internal API and should not impact users. If you are impacted ask for help on the castle-users group on Google Groups.
change - .Properties() methods in registration API have changed behavior and are obsolete now. When calling .Properties() on a component multiple times, subsequent calls with now only be passed properties for which previuos calls returned false. reason - The API was not behaving the way most users expected and the way it was structured it was hard to use. issue - IOC-359 (http://issues.castleproject.org/issue/IOC-359) fix - use either overload taking PropertyFilter enum, or one of the two new methods: PropertiesIgnore() and PropertiesRequire().
change - AbstractComponentActivator constructor takes IKernelInternal instead of IKernel now reason - IKernelInternal exposes a logger which allows activators to log information about their behavior. issue - IOC-359 (http://issues.castleproject.org/issue/IOC-357) fix - update the signature of your custom activator to take IKernelInternal instead of IKernel.
fixed IOC-347 - WithServiceAllInterfaces throws exception (regression)
Breaking Changes:
change - Windsor will no longer allow components from parent container to have dependencies from child container when resolving via child container. Class ParentHandlerWithChildResolver was renamed to ParentHandlerWrapper impact - low fixability - medium description - Previously in some cases, when resolving from child container Windsor would allow component from the parent container to depend on components from a child container. This would lead to all sorts of problems (child coomponents leaking to parent scope, parent components being released prematurely when disposing of the child container etc. Overall this behavior was a mess, and was removed. See http://issues.castleproject.org/issue/IOC-345 for more details fix - If you were depending on the old behavior it is best to restructure your dependencies so you don't have to have those inverted dependencies. Since each scenario is different it's best to discuss any questions you may have on the user group.
change - IHandler.SupportsAssignable(Type) method has been added impact - low fixability - easy description - This was added to better support IGenericServiceStrategy on generic handlers when calling IKernel.GetAssignableHandlers(Type). Now the handler can decide whether it wants to consider itself assigmable to given service. fix - This change affects you only if you're implementing custom IHandler. Implementation is dependent on your usage and semantics you want to support for this scenario. When in doubt ask on castle-users-group on Google Groups.
change - System.String, and some other types can no longer be registered as a service in the container impact - low fixability - easy description - This is something that probably should never have made it into the codebase. Now if you try to register String, a collection of strings or collection of value types Windsor will throw an ArgumentException and not allow you to do that. fix - If you did register those types in the container change them from being components to being parameters on the components that were depending on them.
change - DependencyModel.IsValueType is renamed to DependencyModel.IsPrimitiveTypeDependency. impact - low fixability - easy description - This is part of unification of how types that can not be registered as valid services are found and treated in Windsor. Also the property now returns true if TargetItemType is null. Previously it returned false. fix - Change usages of IsValueType to IsPrimitiveTypeDependency if you depended on behavior when TargetItemType is null, you might also need to check its value to preserve the old behavior.
Nothing published for this version
fixed issue causing IndexOutOfRangeException in heavy load multithreaded scenarios when releasing typed factories or components using DynamicParameter
fixed IOC-266 - Dependency of a generic service is not disposed in Windsor 2.5.x
implemented IOC-243 - Unseal the InterceptorAttribute class
Breaking Changes:
change - One of CreationContext constructors has now additional argument; parent CreationContext Method public IDisposable ParentResolutionContext(...) on CreationContext was removed Method protected CreationContext CreateCreationContext(...) has now additional argument; parent CreationContext impact - low fixability - medium description - To fix issue with false positive cycle detection (see issue IOC-238) changes had to be made to how parent creation context gets propagated in certain situation (when call to kernel.Resolve/ResolveAll is performed as part of resolution process, for example when CollectionResolver is being used). fix - If you override CreateCreationContext method on DefaultKernel pass the additional argument as new constructor parameter to CreationContext. If you were using ParentResolutionContext method it should be fairly safe to remove the call if it was preceded by call to updated CreationContext constructor and the CreationContext is not used outside of local scope. In other cases it's best to consult Castle users group for advice on how to proceed.
change - IReference<> interface has two new methods impact - low fixability - easy description - To make it possible to statically analyze dynamic dependencies provided by the IReference interface two new methods were added: void Attach(DependencyModelCollection dependencies); void Detach(DependencyModelCollection dependencies); fix - if you're providing dependencies on a component from the container call Attach so that reference gets a chance to create and add DependencyModel for that dependency so that it can be statically analyzed by the container.
change - Method IDependencyResolver.Initialize change signature impact - low fixability - easy description - To make it possible to use custom DependencyResolver inheriting from DefaultDependencyResolver initialization of DefaultDependencyResolver was moved out of its constructor and to IDependencyResolver.Initialize method which now takes IKernel as its additional parameter fix - if you're implementing the interface adjust signature of the overriding method to public void Initialize(IKernel kernel, DependencyDelegate dependencyDelegate) The method is called by the kernel at the end of its constructor.
change - Changed visibility of members on AbstractFacility to protected and implementation of interface members to explicit. impact - low fixability - easy description - To make it less confusing to users when fluently configuring facilities (via AddFacility<SomeFacility>(f => f.ConfigureSomething()) method) visibility of certain members of AbstractFacility class was changed. Public properties FacilityConfig and Kernel are now protected, and all methods from IFacility interface are implemented explicitly. Additionally protected Dispose method was introduced to allow inheriting classes to still be disposed. fix - If you were using FacilityConfig and/or Kernel properties outside of inherited classes refactor your code accordingly not to do so. If you were overriding Dispose method change its signature from public override void Dispose() to protected override void Dispose()
added "Potential lifestyle mismatches" debugger view item, that will detect and list situations where Singleton depends on Transient or PerWebRequest
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<Type> ServiceSelector(Type type, Type baseType); to public delegate IEnumerable<Type> 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 <httpModules> 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<IInterceptorSelector> Hook from IProxyHook to IReference<IProxyHook> MixIns from object[] to IEnumerable<IReference<object>> 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.
Reverted factory support facility changes in r6595, r6596 and r6653 which fixed IOC-ISSUE-153, however caused other bugs reported on the mailing list
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →