当我尝试进行迁移时,出现此错误。我正在使用SQL Server Express。
System.ArgumentException:不支持关键字:'userid'。在 System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary
2 parsetable, String connectionString, Boolean buildChain, Dictionary
2 同义词,布尔值firstKey)在 System.Data.Common.DbConnectionOptions..ctor(字符串connectionString, 字典2 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 System.Data.SqlClient.SqlConnection..ctor(String connectionString) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection() at Microsoft.EntityFrameworkCore.Internal.LazyRef
1.get_Value()在 Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection() 在 Microsoft.EntityFrameworkCore.Internal.RelationalLoggerExtensions.MigrateUsingConnection(IDiagnosticsLogger`1 诊断,IMigrator迁移器,IRelationalConnection连接)
在 Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(字符串 targetMigration) Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration,字符串contextType)位于 Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase。<> c__DisplayClass0_1。<。ctor> b__0() 在 Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(操作 操作)不支持的关键字:“ userid”。
这是我的appsettings.json
文件中的连接字符串:
Server=.\\SQLEXPRESS;Database=DBNAMEONE;Trusted_Connection=True;MultipleActiveResultSets=true;UserId=USERNAMEONE;Password=PASSWORDONE
我尝试从字符串中完全删除UserId
,但仍然收到此错误。我不确定如何继续在其他应用程序上使用,此连接字符串是否可以正常工作。