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
There is inconsistent behaviour when beginning a new lifetime scope between LifetimeScope.BeginLifetimeScope(object) and LifetimeScope.BeginLifetimeScope(object, Action<ContainerBuilder>).
As indicated by the test NestedScopeTests.BeginLifetimeScopeCannotBeCalledWithDuplicateTag this will fail:
var rootScope = new ContainerBuilder().Build();
const string duplicateTagName = "ABC";
var taggedScope = rootScope.BeginLifetimeScope(duplicateTagName);
var differentTaggedScope = taggedScope.BeginLifetimeScope("DEF");
Assert.Throws<InvalidOperationException>(() => differentTaggedScope.BeginLifetimeScope(duplicateTagName));
If I use LifetimeScope.BeginLifetimeScope(object, Action<ContainerBuilder>) then this will not throw an exception:
var rootScope = new ContainerBuilder().Build();
const string duplicateTagName = "ABC";
var taggedScope = rootScope.BeginLifetimeScope(duplicateTagName);
var differentTaggedScope = taggedScope.BeginLifetimeScope("DEF");
Assert.Throws<InvalidOperationException>(() => differentTaggedScope.BeginLifetimeScope(duplicateTagName, builder => builder.RegisterType<object>()));
The text was updated successfully, but these errors were encountered:
There is inconsistent behaviour when beginning a new lifetime scope between
LifetimeScope.BeginLifetimeScope(object)
andLifetimeScope.BeginLifetimeScope(object, Action<ContainerBuilder>)
.As indicated by the test
NestedScopeTests.BeginLifetimeScopeCannotBeCalledWithDuplicateTag
this will fail:If I use
LifetimeScope.BeginLifetimeScope(object, Action<ContainerBuilder>)
then this will not throw an exception:The text was updated successfully, but these errors were encountered: