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
[Test]publicvoidIsRegisteredTest(){voidTest(TypetypeFrom,TypetypeTo){varcontainerBuilder=newContainerBuilder();containerBuilder.RegisterGeneric(typeTo).As(typeFrom);varcontainer=containerBuilder.Build();Assert.IsFalse(container.IsRegistered(typeFrom));}Test(typeof(IFoo<>),typeof(Foo<>));// PassedTest(typeof(Foo<>),typeof(Foo<>));// Failed with "IndexOutOfRangeException".}publicinterfaceIFoo<T>{}publicclassFoo<T>:IFoo<T>{}
The stack trace:
System.IndexOutOfRangeException : Index was outside the bounds of the array.
at Autofac.Util.TypeExtensions.IsCompatibleWithGenericParameterConstraints(Type genericTypeDefinition, Type[] parameters)
at Autofac.Features.OpenGenerics.OpenGenericServiceBinder.TryBindServiceType(Service service, IEnumerable`1 configuredOpenGenericServices, Type openGenericImplementationType, Type& constructedImplementationType, Service[]& constructedServices)
at Autofac.Features.OpenGenerics.OpenGenericRegistrationSource.RegistrationsFor(Service service, Func`2 registrationAccessor)+MoveNext()
at Autofac.Core.Registration.ComponentRegistry.GetInitializedServiceInfo(Service service)
at Autofac.Core.Registration.ComponentRegistry.IsRegistered(Service service)
at Autofac.ResolutionExtensions.IsRegisteredService(IComponentContext context, Service service)
at Autofac.ResolutionExtensions.IsRegistered(IComponentContext context, Type serviceType)
The text was updated successfully, but these errors were encountered:
RaymondHuy
added a commit
to RaymondHuy/Autofac
that referenced
this issue
Nov 5, 2019
It will be released in 5.0. There is no timeline set on 5.0. If you'd like to see a faster 5.0 release, helping out in the form of pull requests is the best way to accelerate the timeline.
Assembly version: 4.9.4.0
The stack trace:
The text was updated successfully, but these errors were encountered: