Simple Injector: RegisterInitializer does not always fire
问题 I use the RegisterInitializer method to inject properties in base types as follows: container.RegisterInitializer<BaseHandler>(handler => { handler.Context = container.GetInstance<HandlerContext>(); }); This works great, but the RegisterInitializer doesn't get fired on all registered types that inherit from BaseHandler. It doesn't seem to run when I call new myself: var url = ConfigurationManager.AppSettings["NotificationServiceUrl"]; container.Register<Handler<NotifyCustomerMessage>>(() =>