Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,128 | Comments: 45,551

filter by tags archive

Didja know? Merging Windsor configuration with automatic registration

time to read 2 min | 373 words

One of the most annoying things that we have to do during development is updating configuration files. That is why convention over configuration is such a successful concept. The problem is what to do when you can mostly use the convention, but need to supply configuration values as well.

Well, one of the nice things about Windsor is the ability to merge several sources of information transparently. Given this configuration:

		<section name="castle"
			type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
			<facility id="rhino.esb" >
				<bus threadCount="1"
			<component id="Demo.Backend.SendEmailConsumer">

And this auto registration:

var container = new WindsorContainer(new XmlInterpreter());
	AllTypes.Of(typeof (ConsumerOf<>))

We now get the benefit of both convention and configuration. We can let the convention pick up anything that we need, and configure just the values that we really have to configure.


Bill Pierce

How did we ever code before Windsor?


Excuse my ignorance; what does castle Windsor do?


Heh, I guess I had that coming...


Thanks Ayende, I like this flexibility as well - glad to see you point this out.

Speaking of:


AllTypes.Of(typeof (ConsumerOf<>))



Is that possible to do in xml right now ?

The features of adding all types of an assembly is one of my favorites, and why I end up doing it in code. So I've been curious if that is a part of the xml capability?

So far, I love how this works with asp.net mvc

Using MvcContrib I register all my controllers, then all the services that the controllers use (using your syntax above), then all the DAO's that the services use.

It's a thing of beauty :)

I blog about how to do the event wiring programmatically as well:


Again, thanks for pointing out how to combine the two together!

Happy New Year!

Ayende Rahien


No, you can't do that from XML by default.

It should be pretty easy to write a facility to do this, however.

Comment preview

Comments have been closed on this topic.


  1. The worker pattern - 4 hours from now

There are posts all the way to May 30, 2016


  1. The design of RavenDB 4.0 (14):
    26 May 2016 - The client side
  2. RavenDB 3.5 whirl wind tour (14):
    25 May 2016 - Got anything to declare, ya smuggler?
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats