Welcome Guest, you are in: Login

Castle Project

RSS RSS

Navigation (Windsor)






Search the wiki
»

PoweredBy

This documentation is a work in progress.

Let us know if some information is not clear, inaccurate or missing. Also feel free to update the wiki yourself.

Castle Windsor

RSS
Modified on 2014/05/27 22:41 by Krzysztof Ko┼║mic Categorized as Uncategorized
Windsor's logo

Windsor's logo

Castle Windsor is best of breed, mature Inversion of Control container available for .NET and Silverlight.

Current version is 3.3.0, released in May 2014.



Show me the code already

Windsor is very simple to use. Code below is not just hello world - that's how many big real life applications use Windsor. See the full documentation for more details on the API, features, patterns, and practices.

//application starts...
var container = new WindsorContainer();

// adds and configures all components using WindsorInstallers from executing assembly
container.Install(FromAssembly.This());

// instantiate and configure root component and all its dependencies and their dependencies and...
var king = container.Resolve<IKing>();
king.RuleTheCastle();

// clean up, application exits
container.Dispose();
So what about those installers? Here's one.

public class RepositoriesInstaller : IWindsorInstaller
{
	public void Install(IWindsorContainer container, IConfigurationStore store)
	{
		container.Register(Classes.FromThisAssembly()
			                .Where(Component.IsInSameNamespaceAs<King>())
			                .WithService.DefaultInterfaces()
			                .LifestyleTransient());
	}
}
For more in-depth sample try the section below, or dive right into API documentation on the right.

Samples and tutorials

Learn Windsor by example by completing step-by-step tutorials. See Windsor in action by exploring sample applications showcasing its capabilities.

Introductory tutorial with ASP.NET MVC 3




Documentation


Concepts


Using the Container


Customizing the container


Extending the container


Know any other container already?


Resources


 


ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.