postgresql - 系统参数异常 : 'Keyword not supported: ' host'. '

标签 postgresql asp.net-core-2.0

从 asp.net core 应用程序连接 postgresql 时出现以下错误。

System.ArgumentException: 'Keyword not supported: 'host'.'

连接字符串:

"DefaultConnection": "Host=localhost;Database=MyDB;Username=postgres;Password=pwd;  Pooling=true"

enter image description here

最佳答案

创建一个小型控制台应用程序并使用 NpgSql 尝试使用相同的连接字符串进行连接。

添加 npgsql package from nuget并尝试这里的“入门”片段 npgsql getting started使用你的 conn 字符串

关于postgresql - 系统参数异常 : 'Keyword not supported: ' host'. ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53296789/

相关文章:

python - 在不使用循环的情况下将大量 JSON 数据插入数据库的其他方法

c# - .net 核心控制台应用程序作为 Windows 服务-是否可以在不使用 Kill() 方法的情况下安全地终止已启动进程的执行?

c# - 使用 VS2017 中的 AWS Serverless Application 读取 appsettings.json 文件

c# - VS2017 .Net Core 2.0 测试 : "Failed to initialize client proxy: could not connect to test process"

.net - 使用 VS2017 在 iisexpress 上部署 ASP.NET 核心 2.0 Web 应用程序导致 HTTP 错误 502.3 - 错误网关

asp.net-mvc - Asp.net core 2中View和Page有什么区别?

sql - 在 Postgresql 中创建一个不返回复合值的函数

node.js - 如何创建一个固定长度的自动递增 id (sequelize)

python - 需要条件和转换的计算字段的 Django 查询表达式

sql - 动态查询中的条件 WHERE 表达式