Setting up Windsor for auto registration of components

time to read 1 min | 82 words

I was asked how to do this, but this is frightfully simple:

controllersAsm = Assembly.Load("MyApp.Controlls")
for type in controllersAsm.GetTypes():
	if typeof(BaseController).IsAssignableFrom(type):
		Component(type.Name, type)

This example is using Binsor, executable configuration can do some really nice things.

Another option would be to build a facility to do this, which is about the same amount of code.