At the time you want to change the registration, create a new ContainerBuilder
, register the new instance, and call Update
passing in the container:
// at some later point...
builder = new ContainerBuilder();
builder.RegisterInstance(myType2);
builder.Update(container);