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

Singletons are getting disposed #20

Open
kvanover opened this issue Jan 10, 2017 · 2 comments
Open

Singletons are getting disposed #20

kvanover opened this issue Jan 10, 2017 · 2 comments

Comments

@kvanover
Copy link

I have a problem with registered entries as singleton.
If I add a registration as a singleton (with IDisposable as interface), these objects are getting disposed on request ending in aspnetcore, but still exists in the container on the next request, but disposed off course.

Is this normal? I would think if you register a singleton, It would not get disposed on request scope?

ex: container.Configure(x => x.For(serviceType).Use(implementationType).Singleton());

Thanks,

Koen

@valerysntx
Copy link

combining singletone and idisposable is considered as a bad idea :)

@khellang
Copy link
Member

Hmm. I'll have a look. It sounds really weird that a singleton should be disposed when a nested container is disposed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants