You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Simple Injector integration packages allows cross wiring of services provided by the ASP.NET Core configuration system. In doing so, however, it partly takes control and ensures disposal. The Core configuration system, unfortunately, disposes those components as well, causing a dependency to be disposed twice.
Due to the contract of IDisposable, this shouldn't be a problem. Classes must allow Dispose to be called multiple times without causing problems.
Developers, however, don't always work according to this pattern, and this might cause performance issues when Dispose is called multiple times.
Since Simple Injector can not take ownership of those components, it should let Core dispose of these instances (as there is no way to instruct Core to not dispose of those instances anyway) and prevent disposing them.
This does mean, however, introducing a change to the Simple Injector core library as it does allow disabling the disposal of Scoped or Singleton components (this is a feature that had been removed with the introduction of v3.0). The change for the core library is described in #706.
The text was updated successfully, but these errors were encountered:
The Simple Injector integration packages allows cross wiring of services provided by the ASP.NET Core configuration system. In doing so, however, it partly takes control and ensures disposal. The Core configuration system, unfortunately, disposes those components as well, causing a dependency to be disposed twice.
Due to the contract of
IDisposable
, this shouldn't be a problem. Classes must allowDispose
to be called multiple times without causing problems.Developers, however, don't always work according to this pattern, and this might cause performance issues when
Dispose
is called multiple times.Since Simple Injector can not take ownership of those components, it should let Core dispose of these instances (as there is no way to instruct Core to not dispose of those instances anyway) and prevent disposing them.
This does mean, however, introducing a change to the Simple Injector core library as it does allow disabling the disposal of
Scoped
orSingleton
components (this is a feature that had been removed with the introduction of v3.0). The change for the core library is described in #706.The text was updated successfully, but these errors were encountered: