Identityserver4: Receiving error: Method 'FindIdentityResourcesByScopeNameAsync' does not have an implementation

Created on 29 Apr 2020  路  3Comments  路  Source: IdentityServer/IdentityServer4

I'm attempting to execute the following:

            var builder = services.AddIdentityServer(
                    options => { options.IssuerUri = "https://boo.com"; })
                .AddExtensionGrantValidator<LPDelegationGrantValidator>()
                .AddProfileService<ONBProfileService>()

                .AddOperationalStore(options =>
                {
                    options.ConfigureDbContext = b =>
                    {
                        b.UseSqlServer(connectionString, db => db.MigrationsAssembly(migrationsAssembly));
                    };
                })
                .AddConfigurationStore(options =>
                {
                    options.ConfigureDbContext = b =>
                    {
                        b.UseSqlServer(connectionString, db => db.MigrationsAssembly(migrationsAssembly));
                    };
                });

This used to work but then I moved the solution to a different location and renamed some of my projects. Now it's crashing with the the following error.

I've tried aligning the versions of the packages I'm referencing to v3.1.3 but it's not fixing this.

Have you seen this error before? Is there a straight-forward way to resolve it?

 System.TypeLoadException
  HResult=0x80131522
  Message=Method 'FindIdentityResourcesByScopeNameAsync' in type 'IdentityServer4.EntityFramework.Stores.ResourceStore' from assembly 'IdentityServer4.EntityFramework.Storage, Version=3.1.3.0, Culture=neutral, PublicKeyToken=f294d0afe402bb2b' does not have an implementation.
  Source=IdentityServer4.EntityFramework
  StackTrace:
   at Microsoft.Extensions.DependencyInjection.IdentityServerEntityFrameworkBuilderExtensions.AddConfigurationStore[TContext](IIdentityServerBuilder builder, Action`1 storeOptionsAction)
   at Microsoft.Extensions.DependencyInjection.IdentityServerEntityFrameworkBuilderExtensions.AddConfigurationStore(IIdentityServerBuilder builder, Action`1 storeOptionsAction)
   at IdSrv_Host_Console.Startup.GetSqlConfigurationBuilder(IServiceCollection services) in C:\Workspace\dev\live-person-sts-id4\IdentityServer4\Bupa_src\Idsrv_Host_Console\Startup.cs:line 75
   at IdSrv_Host_Console.Startup.ConfigureServices(IServiceCollection services) in C:\Workspace\dev\live-person-sts-id4\IdentityServer4\Bupa_src\Idsrv_Host_Console\Startup.cs:line 49
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass15_0.<BuildStartupServicesFilterPipeline>g__RunPipeline|0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.<ConfigureServices>g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)

Most helpful comment

Hello, I had this error because I had IdentityServer4 beta 4 installed, while the other packages where 3.1.3. After installing IdentityServer4 3.1.3, this error was gone.

All 3 comments

Hello, I had this error because I had IdentityServer4 beta 4 installed, while the other packages where 3.1.3. After installing IdentityServer4 3.1.3, this error was gone.

Thanks @1Jesper1, after much banging my head on the wall I eventually came to that conclusion too. For some reason some of the packages were defaulting to the preview versions and that was screwing me up.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings