[ad_1]
この問題はどうすれば解決できますか?
私
PM> Add-Migration cmdlet Add-Migration at command pipeline position 1 Supply values for the following parameters: Name: InitialDatabse Build started... Build succeeded. To undo this action, use Remove-Migration. PM> Update-Database Build started... Build succeeded. System.ArgumentException: Keyword not supported: 'datasource'. at Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey) at Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms) at Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) at Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) at Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnectionState() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.<Exists>b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0`2.<Execute>b__0(DbContext c, TState s) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation, Func`2 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists() 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 connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Keyword not supported: 'datasource'. What I have tried: <pre>I wrote these commands but it was not done successfully in the update section
解決策 1
SQL 接続文字列には「データソース」はありません。「データ ソース」があるため、そこにスペースが必要なだけかもしれません (ただし、ほとんどの人は代わりに「サーバー」を使用します)。
解決策 2
PM> データベースの更新
ビルドが開始されました…
ビルドに成功しました。
System.ArgumentException: サポートされていないキーワード: ‘trusted_conncetion’。
Microsoft.Data.Common.DbConnectionOptions.ParseInternal (Dictionary`2 解析可能、String connectionString、Boolean buildChain、Dictionary`2 シノニム、Boolean firstKey) で
Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString、Dictionary`2 の同義語)
Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString) で
Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString、DbConnectionOptions 以前) で
Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey キー、DbConnectionPoolGroupOptions poolOptions、DbConnectionOptions& userConnectionOptions) で
Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey キー) で
Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(文字列値)
Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) で
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection() で
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection() で
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(ブール値のerrorsExpected)で
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.
Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0`2.
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute で[TState,TResult](TState 状態、Func`3 操作、Func`3 verifySucceeded)
Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute で[TState,TResult](IExecutionStrategy ストラテジー、TState 状態、Func`2 操作、Func`2 verifySucceeded)
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists) で
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists() で
Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists() で
Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) で
Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType) で
Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType) で
Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0() で
Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action アクション) で
サポートされていないキーワード: 「trusted_conncetion」。
何が問題ですか
[ad_2]
コメント