我真的很难让这个工作。我有一个连接字符串,我想用NpgSql提供程序添加应用程序名。根据to this SO post我应该使用ApplicationName,根据PostgreSQL docs我应该使用application_name。我的问题是这两个都不适合我。
连接字符串:

<add name="Site" connectionString="Server=******;Port=******;Database==******;User Id==******;Password==******;SearchPath==******;ApplicationName=test" providerName="NpgSql"/>

错误:
key=value argument incorrect in ConnectionString
Parameter name: applicationname

连接字符串:
<add name="Site" connectionString="Server=******;Port=******;Database==******;User Id==******;Password==******;SearchPath==******;application_name=test" providerName="NpgSql"/>

错误:
key=value argument incorrect in ConnectionString
Parameter name: application_name

最佳答案

如果有人在寻找这个问题的答案,下面是解决方法:
application_name=MyApp不适用于npgsql版本2.2.4.3(最新版本2015-02-05)
将应用程序名更改为application name=MyAp
答案也提供给上面发问者发布的链接。

10-07 12:36
查看更多