小编Lea*_*ner的帖子

“Npgsql.PoolManager”的类型初始值设定项引发异常

获取此异常“'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 设置运行此函数。请帮忙。

.net c# postgresql-10

3
推荐指数
1
解决办法
3855
查看次数

标签 统计

.net ×1

c# ×1

postgresql-10 ×1