我在Visual Studio 2017 Preview中使用IdentityServer4-2.0.0-preview2
和IdentityServer4.EntityFramework-1.0.1
。我得到了一个例外情况如下:
System.TypeLoadException:“类型中的方法'GetAllResourcesAsync' 来自程序集的'IdentityServer4.EntityFramework.Stores.ResourceStore' 'IdentityServer4.EntityFramework,Version = 1.0.1.0,Culture = neutral, PublicKeyToken = null'没有实现。“
这是我的代码:
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddCookieAuthentication();
var connectionString = Configuration.GetConnectionString("DefaultConnection");
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
services.AddDbContext<EntityLibrary.Models.ExportOMSContext>(options => options.UseSqlServer(connectionString));
var service_builder = services.AddIdentityServer();
service_builder.AddDeveloperSigningCredential();
service_builder.AddConfigurationStore(builder =>builder.UseSqlServer(connectionString));
service_builder.AddOperationalStore(builder =>builder.UseSqlServer(connectionString));
service_builder.Services.AddTransient<IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator>();
}
答案 0 :(得分:0)
EF nuget现在还没有在asp net core 2上工作。您可以尝试自己构建源代码。