我從.NET Core 1.1升級到.NET Core 2.0並遇到以下問題(我也升級了一些庫以支持.net core 2.0)IdentityServer4升級到.NET Core 2.0(AddConfigurationStore,AddOperationalStore)的問題
CS1929「ConfigurationStoreOptions」不包含關於「UseNpgsql」和最好的擴展方法過載的定義「NpgsqlDbContextOptionsExtensions.UseNpgsql(DbContextOptionsBuilder,串,動作)」要求式「DbContextOptionsBuilder」
Startup.cs
的接收機 services.AddIdentityServer()
.AddSigningCredential(Certificate.Get())
.AddAspNetIdentity<User>()
.AddConfigurationStore(builder =>
builder.UseNpgsql(connectionString, options =>
options.MigrationsAssembly(migrationsAssembly)))
.AddOperationalStore(builder =>
builder.UseNpgsql(connectionString, options =>
options.MigrationsAssembly(migrationsAssembly)));
使用UseSqlServer
時
同樣的問題
// configure identity server with in-memory users, but EF stores for clients and resources
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddTestUsers(Config.GetUsers())
.AddConfigurationStore(builder =>
builder.UseSqlServer(connectionString, options =>
options.MigrationsAssembly(migrationsAssembly)))
.AddOperationalStore(builder =>
builder.UseSqlServer(connectionString, options =>
options.MigrationsAssembly(migrationsAssembly)));
http://docs.identityserver.io/en/release/quickstarts/8_entity_framework.html
注:我已經加入 「使用Microsoft.EntityFrameworkCore;」
2.0.0 RC1剛剛發佈的NuGet該目標netstandard 2.0 –