diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeAccessor.cs b/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeAccessor.cs index 048e8ac59..9042944d7 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeAccessor.cs +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Scope/ExtensionContainerScopeAccessor.cs @@ -14,8 +14,6 @@ namespace Castle.Windsor.Extensions.DependencyInjection.Scope { - using System; - using Castle.MicroKernel.Context; using Castle.MicroKernel.Lifestyle.Scoped; @@ -23,7 +21,7 @@ internal class ExtensionContainerScopeAccessor : IScopeAccessor { public ILifetimeScope GetScope(CreationContext context) { - return ExtensionContainerScopeCache.Current ?? throw new InvalidOperationException("No scope available"); + return ExtensionContainerScopeCache.Current; } public void Dispose()