Is it possible to register a service at run-time, meaning after the ContainerBuilder
has been built and the Container
has been created (and ContainerBuilder
disposed of)?
Yes you can, using the Update
method on ContainerBuilder
:
var newBuilder = new ContainerBuilder();
newBuilder.Register...;
newBuilder.Update(existingContainer);