Identityserver4 quickstart EF迁移-InvalidOperationException:未配置签名凭据

Identityserver4 quickstart EF迁移-InvalidOperationException:未配置签名凭据,identityserver4,entity-framework-migrations,Identityserver4,Entity Framework Migrations,我有一个基于quickstart的MVC客户端访问API。我目前正试图通过以下EF Migrations quickstart示例,用SQL Server替换内存中的配置和数据。我所有的db表似乎都创建和填充得很好,但是当我运行客户端时,我得到了一个“InvalidOperationException:没有配置签名凭据”错误。我的用户id和密码没有更改,我看到IdentityServer在调试模式下加载预定义的用户信息。我还需要改变什么才能使它再次工作 这是我的IdentityServer的新配

我有一个基于quickstart的MVC客户端访问API。我目前正试图通过以下EF Migrations quickstart示例,用SQL Server替换内存中的配置和数据。我所有的db表似乎都创建和填充得很好,但是当我运行客户端时,我得到了一个“InvalidOperationException:没有配置签名凭据”错误。我的用户id和密码没有更改,我看到IdentityServer在调试模式下加载预定义的用户信息。我还需要改变什么才能使它再次工作

这是我的IdentityServer的新配置服务

public void ConfigureServices(IServiceCollection services)
{
    services.AddControllersWithViews();

    var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
    const string connectionString = @"Server=.;Database=MyIDS;trusted_connection=True;";

    services.AddIdentityServer()
        .AddTestUsers(TestUsers.Users)
        .AddConfigurationStore(options =>
        {
            options.ConfigureDbContext = b => b.UseSqlServer(connectionString,
                sql => sql.MigrationsAssembly(migrationsAssembly));
        })
        .AddOperationalStore(options =>
        {
            options.ConfigureDbContext = b => b.UseSqlServer(connectionString,
                sql => sql.MigrationsAssembly(migrationsAssembly));
        });
}

我解决了这个问题-我需要在ConfigureServices方法中调用.AddDeveloperSigningCredential()