I'm trying to figure out how to have Castle Windsor resolve dependancies for objects created using Activator.CreateInstance
.
Currently when I create objects this way, the dependancies inside the created object do not get resolved. I've had a search around to see if there's a Windsor method that does the same thing whilst also resolving the dependancies but I haven't found anything thus far.
As for why I'm creating instances this way, I'm playing about with a basic text game for a bit of fun and the instances are being created based on user input commands and so I need to create the instance based on a string (currently the command is mapped in a Dictionary to a type which is then created using the above method).
Thanks for any and all help.
AFAIK you can register in castle windsor you can register the so called "named instances" so you can create the object you need by resolving them througth the container without dealing with Activator.CreateInstance that for sure can't perform IoC. Basically you have to register your component with a key:
and then call
to have back your component properly created with all dependencies resoved.