Skip to content

Service registered with ServiceLifetime.Singleton can be created multiple times #63

Open

Description

@Cpa3y
No description provided.

Activity

  1. seesharper commented on Apr 15, 2019

    @seesharper
    Owner

    @Cpa3y Do you have more information on this?

  2. Cpa3y commented on Apr 22, 2019

    @Cpa3y
    Author

    I am using LightInject 5.4.0 in aspnet core 2.2 project. I have added LightInject as described in this instruction https://www.lightinject.net/microsoft.aspnetcore.hosting
    But my services registered in IServiceCollection. And I have service with expensive controller registered as singletone. So this service's constructor may be called twice (or more) if I request this service for the 1st time and 2nd time within small interval.

    I have created small demo project https://github.com/Cpa3y/lightinject-issue-demo

  3. seesharper commented on Apr 22, 2019

    @seesharper
    Owner

    @Cpa3y Thanks for the information. Looking into it

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions