Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project startup template (ASP.NET Core API Module (without UI)) missing Permissions & Settings nuget packages reference,please check it. #872

Closed
CooperLiu opened this issue Mar 13, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@CooperLiu
Copy link

CooperLiu commented Mar 13, 2019

When I tried to run IdentityServerHost, and tied to access http://localhost:61517/.well-known/openid-configuration, then it return 500.

After checked logs, this project missing Volo.Abp.PermissionManagement.EntityFrameworkCore and Volo.Abp.SettingManagement.EntityFrameworkCore nuget packages.

finally, installed these packages, it works.

log message:

2019-03-13 16:56:39.569 +08:00 [FTL] Unhandled exception: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryEndpoint (ReflectionActivator), Services = [IdentityServer4.Endpoints.DiscoveryEndpoint], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryResponseGenerator (ReflectionActivator), Services = [IdentityServer4.ResponseHandling.IDiscoveryResponseGenerator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)
Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryEndpoint (ReflectionActivator), Services = [IdentityServer4.Endpoints.DiscoveryEndpoint], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryResponseGenerator (ReflectionActivator), Services = [IdentityServer4.ResponseHandling.IDiscoveryResponseGenerator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryResponseGenerator (ReflectionActivator), Services = [IdentityServer4.ResponseHandling.IDiscoveryResponseGenerator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) ---> Autofac.Core.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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'.
at Autofac.Core.Activators.Reflection.ReflectionActivator.GetValidConstructorBindings(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable1 parameters)
at IdentityServer4.Hosting.EndpointRouter.GetEndpointHandler(Endpoint endpoint, HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\EndpointRouter.cs:line 52
at IdentityServer4.Hosting.EndpointRouter.Find(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\EndpointRouter.cs:line 39
at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\IdentityServerMiddleware.cs:line 49
2019-03-13 16:56:39.572 +08:00 [ERR] Connection id "0HLL7I742D22T", Request id "0HLL7I742D22T:00000003": An unhandled exception was thrown by the application.
Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryEndpoint (ReflectionActivator), Services = [IdentityServer4.Endpoints.DiscoveryEndpoint], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryResponseGenerator (ReflectionActivator), Services = [IdentityServer4.ResponseHandling.IDiscoveryResponseGenerator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DiscoveryResponseGenerator (ReflectionActivator), Services = [IdentityServer4.ResponseHandling.IDiscoveryResponseGenerator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = AbpResourceOwnerPasswordValidator (ReflectionActivator), Services = [IdentityServer4.Validation.IResourceOwnerPasswordValidator], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> 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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'. (See inner exception for details.) ---> Autofac.Core.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(Volo.Abp.Identity.IdentityUserManager, Microsoft.AspNetCore.Identity.SignInManager1[Volo.Abp.Identity.IdentityUser], IdentityServer4.Services.IEventService, Microsoft.Extensions.Logging.ILogger1[IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator1[Volo.Abp.Identity.IdentityUser]])'.
at Autofac.Core.Activators.Reflection.ReflectionActivator.GetValidConstructorBindings(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable1 parameters)
at IdentityServer4.Hosting.EndpointRouter.GetEndpointHandler(Endpoint endpoint, HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\EndpointRouter.cs:line 52
at IdentityServer4.Hosting.EndpointRouter.Find(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\EndpointRouter.cs:line 39
at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\IdentityServerMiddleware.cs:line 49
at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\IdentityServerMiddleware.cs:line 69
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\Hosting\BaseUrlMiddleware.cs:line 36
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2019-03-13 16:56:39.576 +08:00 [INF] Request finished in 122.7632ms 500

@jakeuj
Copy link

jakeuj commented Mar 14, 2019

I install those two package, but still error.

logs.txt

@CooperLiu
Copy link
Author

CooperLiu commented Mar 15, 2019

@jakeuj
After you have installed,next please check two point.

  1. Make sure IdentityServerHostModule depends on AbpPermissionManagementEntityFrameworkCoreModule and AbpSettingManagementEntityFrameworkCoreModule these two modules
  [DependsOn(
        typeof(AbpAutofacModule),
        typeof(AbpAspNetCoreMvcModule),
        typeof(AbpIdentityAspNetCoreModule),
        typeof(AbpPermissionManagementEntityFrameworkCoreModule), //Notice!!! reference
        typeof(AbpSettingManagementEntityFrameworkCoreModule), //Notice!!! reference
        typeof(AbpIdentityServerEntityFrameworkCoreModule),
        typeof(AbpIdentityEntityFrameworkCoreModule),
        typeof(AbpEntityFrameworkCoreSqlServerModule)
        )]
    public class IdentityServerHostModule : AbpModule
    {
        //ignore 
    }

  1. Make sure DemoAppDbContext -> OnModelCreating had Permission and Setting model configurations
protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            //try to add these two lines
            modelBuilder.ConfigurePermissionManagement();
            modelBuilder.ConfigureSettingManagement();
            //try to add these two lines

            modelBuilder.ConfigureIdentity();
            modelBuilder.ConfigureIdentityServer();
        }

so please check once.

@jakeuj
Copy link

jakeuj commented Mar 15, 2019

@CooperLiu It works now, thanks.
(I can't just add-migration, finally delete and rebuild migration.)

@hikalkan hikalkan added this to the 0.15 milestone Mar 17, 2019
@hikalkan hikalkan reopened this Mar 19, 2019
@hikalkan hikalkan assigned yekalkan and hikalkan and unassigned yekalkan Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants