StructureMap ObjectFactory initialization

Mar 13, 2013 at 2:03 PM
Edited Mar 13, 2013 at 2:04 PM

I consider using Bootstrapper as a convenient way to initialize my application.

I've got a couple custom Registries for StructureMap and my startup code is:


After that I see that Bootstrapper has it's own Container properly initialized but ObjectFactory's container is not initialized at all.

I revised Bootstrapper source code and found out that Bootstrapper does not care about StructureMap's ObjectFactory at all.

It looks like I missed a bit of ideology behind of such behavior.

Could you explain whether it's possible to use Bootstrapper to initialize ObjectFactory, please?
Mar 22, 2013 at 2:04 AM
Hi palazkov,

I see your problem and I think I saw this happening before when trying to use Bootstrapper with NService Bus.
Let me do some digging to see if I can somehow pass the initialized container to the ObjectFactory or something like that.
Thanks for the feedback.

Apr 12, 2013 at 3:57 PM
Hello again,

Check the latest version. Now you can say Boostrapper.With.StructureMap().UsingObjectFactory().Start();


Apr 13, 2013 at 11:04 AM

Now it works like a charm! :)

Thank you!