IOC注入_问题The container is locked after the first call to resolve
依赖注入问题 The container is locked after the first call to resolve When an application makes its first call to GetInstance , GetAllIntances or Verify , the container locks itself to prevent any future changes being made by explicit registrations . This strictly separates the configuration of the container from its use and forces the user to configure the container in one single place . This design decision is inspired by the following design principle: Push developers into best practices In most situations it makes little sense to change the configuration once the application is running . This