Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# '的类型初始值设定项;Npgsql.PoolManager';抛出异常_C#_.net_Postgresql 10 - Fatal编程技术网

C# '的类型初始值设定项;Npgsql.PoolManager';抛出异常

C# '的类型初始值设定项;Npgsql.PoolManager';抛出异常,c#,.net,postgresql-10,C#,.net,Postgresql 10,获取此异常“Npgsql.PoolManager”的类型初始值设定项引发了异常。”仅在窗口7上 public string ValidateDefaultInstancePostgreSqlServer() { string found = "0"; try { using (NpgsqlConnection postGresConnection = new NpgsqlConnection())

获取此异常“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)
        {}
注意:同样的代码在窗口10上可以正常工作。
从installsheild安装程序运行此函数。请提供帮助。

我通过使用最新版本更新System.ValueTuple.dll解决了问题。问题是Npgsql.dll和System.ValueTuple.dll之间不兼容

我认为,如果我们添加了nuget的引用,这个问题就不会出现在第一位。 但奇怪的是,它只出现在Windows7或32位机器上