C# '的类型初始值设定项;Npgsql.PoolManager';抛出异常
获取此异常“Npgsql.PoolManager”的类型初始值设定项引发了异常。”仅在窗口7上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())
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位机器上