Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cpa3y opened this issue Apr 12, 2019 · 3 comments
Labels

Comments

@Cpa3y
Copy link

Cpa3y commented Apr 12, 2019

No description provided.

@seesharper
Copy link
Owner

@Cpa3y Do you have more information on this?

@Cpa3y
Copy link
Author

Cpa3y commented Apr 22, 2019

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

@seesharper
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants