Skip to content

Question about ServiceProvider default lifetime #39

Closed

Description

@kshi219

Hi,

What is the motivation is behind using ExternallyControlledLifetimeManager in the constructor of ServiceProvider? Is it intended that the constructed service provider be explicitly injected by the user into the container with a some chosen lifetime?

Thanks!

Activity

  1. ENikS commented on Mar 15, 2019

    @ENikS
    Contributor
  2. kshi219 commented on Mar 15, 2019

    @kshi219
    Author

    I see. So in our use case we ran into an issue where unless we explicitly held onto a reference of the service provider returned by BuildServiceProvider, like by injecting it into our unity container with ContainerControlledLifeTimeManager, the ServiceProvider would be garbage collected and cause runtime issues. Which led to to this question about what the intended usage pattern should be.

  3. ENikS commented on Mar 15, 2019

    @ENikS
    Contributor

    I would need a code sample to verify your scenario and to fix the issue

  4. self-assigned this
    on Mar 15, 2019
  5. kshi219 commented on Mar 18, 2019

    @kshi219
    Author

    Hi, was away over the weekend, will make one up soon

  6. kshi219 commented on Mar 22, 2019

    @kshi219
    Author

    #40 seems to have a repro attached that captures the essence of what we saw, will not be making another one up, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions