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
I'm trying to make this to work, but getting a RegisteringImplementationNotAssignableToServiceType error:
vargenericType=typeof(IValidator<>).MakeGenericType(typeof(ExtraSettings));varservices=newServiceCollection();// Microsoft.Extensions.DependencyInjectionservices.AddSingleton<IValidator<ExtraSettings>,SettingsValidator>();varcontainer=newContainer();varadaptedContainer=container.WithDependencyInjectionAdapter(services);// this throwsIServiceProviderserviceProvider=adaptedContainer;varvalidator=serviceProvider.GetService(type);
The following is the message of the exceptin throw: code: Error.RegisteringImplementationNotAssignableToServiceType; message: Registering implementation type SettingsValidator is not assignable to service type IValidator<ExtraSettings>.
However, this code(without DryIoC) works as expected:
@PhilippK13 Thanks for reporting and code repro.
It seems that I have already fixed the problem in context of the #418 . But I did not release the fix yet. Hoping to release Today.
Hi.
I have the following hierarchy(simplified for brevity):
I'm trying to make this to work, but getting a RegisteringImplementationNotAssignableToServiceType error:
The following is the message of the exceptin throw:
code: Error.RegisteringImplementationNotAssignableToServiceType; message: Registering implementation type SettingsValidator is not assignable to service type IValidator<ExtraSettings>.
However, this code(without DryIoC) works as expected:
I don't think I'm violating any Type rules, so I expect the DryIoC to work just fine. Is this a bug or am I missing something?
The text was updated successfully, but these errors were encountered: