In SimpleInjectorServiceCollectionExtensions
Hi
I've been trying to use ServiceCollection Integration on a Win Form Project which is defined as Transient in the DefaultLifestyle but i have a problem whenever I use the ServiceCollection Integration, exactly in the AddSimpleInjector method which try change the DefaultScopedLifeStlye (which is null in the first place).
// Set lifestyle before calling setupAction. Code in the delegate might depend on that.
TrySetDefaultScopedLifestyle(container);
private static void TrySetDefaultScopedLifestyle(Container container)
{
if (container.Options.DefaultScopedLifestyle is null)
{
container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
}
}
It throws an exception related that the DefaultScopedLifestyle shouldn't be changed after initialization..
Is this the expected behavior?
Why should it changed to a AsyncScopedLifeStyle if i am working with a Transient lifestyle?
In SimpleInjectorServiceCollectionExtensions
Hi
I've been trying to use
ServiceCollectionIntegration on a Win Form Project which is defined asTransientin theDefaultLifestylebut i have a problem whenever I use theServiceCollectionIntegration, exactly in theAddSimpleInjectormethod which try change theDefaultScopedLifeStlye(which is null in the first place).It throws an exception related that the
DefaultScopedLifestyleshouldn't be changed after initialization..Is this the expected behavior?
Why should it changed to a
AsyncScopedLifeStyleif i am working with aTransientlifestyle?