-
Hi, There is a strange behavior in my project. So Am I wrong? Sample:
.NET SDKs installed: .NET runtimes installed: Example in Github here: DevelopmentTest |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The scope service check only happens in development, originally it was done that way to save on performance at runtime and avoid breaking changes but maybe its time to always do scope validation by default. There is no scope when you inject into a background thread, its a singleton so the "scope" is top level. See https://ankitvijay.net/2020/03/17/net-core-and-di-beware-of-captive-dependency/ |
Beta Was this translation helpful? Give feedback.
The scope service check only happens in development, originally it was done that way to save on performance at runtime and avoid breaking changes but maybe its time to always do scope validation by default. There is no scope when you inject into a background thread, its a singleton so the "scope" is top level.
See https://ankitvijay.net/2020/03/17/net-core-and-di-beware-of-captive-dependency/