0
votes

update-database give this error:

PM> update-database

Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] User profile is available. Using 'C:\Users\henri\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest. Microsoft.EntityFrameworkCore.Infrastructure[10403] Entity Framework Core 2.1.1-rtm-30846 initialized 'SimpleImageGalleryDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None System.ArgumentException: Keyword not supported: 'mutipleactiveresultsets'. at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary2 parsetable, String connectionString, Boolean buildChain, Dictionary2 synonyms, Boolean firstKey) at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary2 synonyms) at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection() at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_02.<Execute>b__0(DbContext c, TState s) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func2 operation, Func`2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)

Keyword not supported: 'mutipleactiveresultsets'.

My appsettings.json:

{
   "ConnectionStrings": 
   {
       "DefaultConnection":"Server=(localdb)\\mssqllocaldb;Database=SimpleImageGallery;Trusted_Connection=True;MutipleActiveResultSets=true;"
   },
   "Logging": 
   {
       "IncludeScopes":false,
       "LogLevel": 
       {
           "Default":"Warning"
       }
   }
}

Startup.cs

public void ConfigureServices(IServiceCollection services)
{
    services.AddDbContext<Data.SimpleImageGalleryDbContext>(options =>
    options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
    services.AddMvc();
}
1
Looks like you've misspelled multiple as mutiple.Kirk Larkin
Thank you so much! :) . It was very stupid ;)Henrik

1 Answers

-1
votes

I had similar issue using EF core 2.2 / SQLExpress.

The cause of the problem is the provider setting in connection string:

Provider=SQLNCLI11;Data Source=LENOVOTOUCH\sqlExpress;
Integrated Security=SSPI;
Initial Catalog=XXX

The solution is to remove the Provider setting.