I would register components in the container before passing it to the InMemoryServer. Even though this might work we could run into weird issues if the InMemoryServer becomes more complicated and needs objects on the Container within it's constructor.

Basically we should mimic a container in a real app, where the container gets fully configured before it's used in the application.