获取此异常“'Npgsql.PoolManager' 的类型初始值设定项引发异常。” 仅在窗口 7 上。
public string ValidateDefaultInstancePostgreSqlServer()
{
string found = "0";
try
{
using (NpgsqlConnection postGresConnection = new NpgsqlConnection())
{
postGresConnection.ConnectionString = "Server=localhost;Port=5432;Database=postgres;User Id=postgres;Password=postgre123;Pooling=true;MinPoolSize=1;MaxPoolSize=100;Command Timeout=600;Timeout=600;";
using (NpgsqlCommand checkDBCommand = postGresConnection.CreateCommand())
{
postGresConnection.Open();
found = "1";
}
}
}
catch (Exception e)
{}
Run Code Online (Sandbox Code Playgroud)
注意:相同的代码在窗口 10 上工作正常。从 installsheild 设置运行此函数。请帮忙。