Ich habe versucht, IdentityServer4 Version 1.5.2 für ein paar Tage jetzt ohne Erfolg zu funktionieren. Ich verwende VS2017 Meine Entity-Klassen, DataContexts, Repositorys und Migrationen sind resident in einer .Net-Standardbibliothek (1.6). So weit so gut, außer wenn ich update-migration-Befehl für "PersistenGrantDbContext" und "ConfigurationDbCOntext" ausführe. Ich erhalte die FehlermeldungUpdate Migrationsbefehl schlägt fehl für ConfigurationDbContext und PersistentGrantDbContext
Could not load file or assembly 'System.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Datacontext Klassen, die ich erstellt selbst scheinen nicht, dieses Problem zu haben, nachdem „IDbContextFactory“ Schnittstelle Hier habe ich die Umsetzung für die beiden Täter
public class TemporaryDbContextFactoryScopes : IDbContextFactory<PersistedGrantDbContext>
{
public PersistedGrantDbContext Create(DbContextFactoryOptions options)
{
var builder = new DbContextOptionsBuilder<PersistedGrantDbContext>();
builder.UseSqlServer("Server=-------;Database=-----------;Trusted_Connection=True;MultipleActiveResultSets=true",
optionsBuilder => optionsBuilder.MigrationsAssembly(typeof(UserDbContext).GetTypeInfo().Assembly.GetName().Name));
return new PersistedGrantDbContext(builder.Options, new OperationalStoreOptions());
}
}
public class TemporaryDbContextFactoryOperational : IDbContextFactory<ConfigurationDbContext>
{
public ConfigurationDbContext Create(DbContextFactoryOptions options)
{
var builder = new DbContextOptionsBuilder<ConfigurationDbContext>();
builder.UseSqlServer("Server=---------;Database=--------;Trusted_Connection=True;MultipleActiveResultSets=true",
optionsBuilder => optionsBuilder.MigrationsAssembly(typeof(UserDbContext).GetTypeInfo().Assembly.GetName().Name));
return new ConfigurationDbContext(builder.Options, new ConfigurationStoreOptions());
}
}
Umsetzung Ich habe installiert die neueste Version von System.Data.SqlClient immer noch nicht funktioniert
und die Versionsnummer der neuesten einem hilft, ist 4.1.0.0 wie die Fehlermeldungen? – Mashton
Nein, die neueste Version ist 4.3.1, aber ich habe es vor einiger Zeit mit unorthodoxen Mitteln gelöst –