abp icon indicating copy to clipboard operation
abp copied to clipboard

DependencyResolutionException error after add app.UseIdentityServer();

Open ruby0602 opened this issue 6 years ago • 8 comments

I added a new template width angular and identityserver separated, after added app.UseIdentityServer(); into HttpApiHostModule.cs, there is error in the below, where is the problem? thanks in advance

An unhandled exception occurred while processing the request. DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Volo.Abp.IdentityServer.AspNetIdentity.AbpResourceOwnerPasswordValidator' can be invoked with the available services and parameters: Cannot resolve parameter 'Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser] signInManager' of constructor 'Void .ctor(Microsoft.AspNetCore.Identity.UserManager1[Volo.Abp.Identity.IdentityUser], Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], Volo.Abp.Identity.IdentitySecurityLogManager, IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]], Microsoft.Extensions.Localization.IStringLocalizer1[Volo.Abp.IdentityServer.Localization.AbpIdentityServerResource], Microsoft.Extensions.Options.IOptions`1[Volo.Abp.Identity.AbpIdentityOptions], Volo.Abp.DependencyInjection.IHybridServiceScopeFactory)'. Autofac.Core.Activators.Reflection.ReflectionActivator.GetValidConstructorBindings(ConstructorInfo[] availableConstructors, IComponentContext context, IEnumerable parameters)

DependencyResolutionException: An exception was thrown while activating IdentityServer4.Endpoints.DiscoveryEndpoint -> IdentityServer4.ResponseHandling.DiscoveryResponseGenerator -> Volo.Abp.IdentityServer.AspNetIdentity.AbpResourceOwnerPasswordValidator. Autofac.Core.Resolving.InstanceLookup.CreateInstance(IEnumerable parameters)

image

ruby0602 avatar Oct 02 '20 02:10 ruby0602

Please use the startup template to reproduce.

realLiangshiwei avatar Oct 02 '20 02:10 realLiangshiwei

Please use the startup template to reproduce.

I reproduced the template, it had the same error

ruby0602 avatar Oct 02 '20 07:10 ruby0602

Can you upload the project to Github and write the repository address in here

realLiangshiwei avatar Oct 02 '20 07:10 realLiangshiwei

@realLiangshiwei https://github.com/ruby0602/httpapihost,code had been uploaded

ruby0602 avatar Oct 02 '20 11:10 ruby0602

@realLiangshiwei link with error is https://localhost:44387/.well-known/openid-configuration

ruby0602 avatar Oct 02 '20 11:10 ruby0602

The project you uploaded is not full

realLiangshiwei avatar Oct 02 '20 12:10 realLiangshiwei

@realLiangshiwei you call me to upload the solution or project?

ruby0602 avatar Oct 02 '20 12:10 ruby0602

@realLiangshiwei thanks,I found the problem is the separate identityServer mode, integrated mode is fine.

ruby0602 avatar Oct 03 '20 12:10 ruby0602