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
Not 100% sure if should go to Autofac.Core or here.
Getting this exception when resolving SiglanR IHubContext<Hub,IClient>, resolving IHubContext<Hub> works fine.
If .ConfigureServices(services => services.AddAutofac()) is commented out, both services can be resolved. Everything works fine if I use MS dependency Injection.
ASP,NET Core 2.1
Autofac 4.9.3
Autofac.Extensions.DependencyInjection 4.4.0
Steps to reproduce
Download and run attached example.
Exception
System.InvalidOperationException
HResult=0x80131509
Message=This operation is only valid on generic types.
Source=System.Private.CoreLib
StackTrace:
at System.RuntimeType.GetGenericTypeDefinition()
at Autofac.Util.TypeExtensions.ParameterCompatibleWithTypeConstraint(Type parameter, Type constraint)
at Autofac.Util.TypeExtensions.<>c__DisplayClass7_1.<IsCompatibleWithGenericParameterConstraints>b__1(Type constraint)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
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>d__3.MoveNext()
at Autofac.Core.Registration.ComponentRegistry.GetInitializedServiceInfo(Service service)
at Autofac.Core.Registration.ComponentRegistry.TryGetRegistration(Service service, IComponentRegistration& registration)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
at SignalRTest1.Startup.ConfigureServices(IServiceCollection services) in D:\Temp\AutofacIssue\Startup.cs:line 41
this bug has already been fixed by @alistairjevans in the Autofacrepository . Only version 4.9.3 is affected from that. Until we have released a new version of Autofac downgrading to 4.9.2 fixes the issue.
Not 100% sure if should go to Autofac.Core or here.
Getting this exception when resolving SiglanR
IHubContext<Hub,IClient>
, resolvingIHubContext<Hub>
works fine.If
.ConfigureServices(services => services.AddAutofac())
is commented out, both services can be resolved. Everything works fine if I use MS dependency Injection.Steps to reproduce
Download and run attached example.
Exception
AutofacIssue.zip
The text was updated successfully, but these errors were encountered: