不支持关键字:数据源(参数'keyword')

Keyword not supported: data source (Parameter 'keyword')

enter image description here我正在尝试通过 Pg Admin 连接到我的 Azure PostgreSql 数据库服务器 但是在 Update-Database 命令之后的控制台中我得到一个错误:

Keyword not supported: data source (Parameter 'keyword')

堆栈:

System.ArgumentException: Keyword not supported: data source (Parameter 'keyword')
   at Npgsql.NpgsqlConnectionStringBuilder.GetProperty(String keyword)
   at Npgsql.NpgsqlConnectionStringBuilder.set_Item(String keyword, Object value)
   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
   at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.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: data source (Parameter 'keyword')

连接字符串:

"ConnectionStrings": {
    "DefaultConnection": "Host=postgre-azure...;Port=5432; Pwd = [Password];"

另一个有同样问题的连接字符串:

"DefaultConnection": "User Id =postgres;Password=123321;Server=postgre-azure...;Port=5432;Database=[];Integrated Security=true;Pooling=true;" 

有人知道它可能是什么吗?

Build started...
Build succeeded.
System.ArgumentException: Keyword not supported: data source (Parameter 'keyword')
   at Npgsql.NpgsqlConnectionStringBuilder.GetProperty(String keyword)
   at Npgsql.NpgsqlConnectionStringBuilder.set_Item(String keyword, Object value)
   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
   at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.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: data source (Parameter 'keyword')
PM> ```

我重做了“ConnectionStrings”:{ “DefaultConnection”:“主机 = ;端口 = 5432;用户名 = ;密码 ​​= ;数据库 = 用户;SSL 模式 = 需要”