Package: libnpgsql2.2-cil
Version: 2.2.7+dfsg3-1
Severity: important
Tags: patch
Dear Maintainer,
To provide DbProviderFactory support, the client component needs to be
registered in the machine.config file as well as the GAC.
In the machine.config file for each .NET version supported,
look for section: <system.data><DbProviderFactories> and add the following:
<add
name="Npgsql Data Provider"
invariant="Npgsql"
description=".NET Data Provider for PostgreSQL"
type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.7.0, Culture=neutral,
PublicKeyToken=5d8b90d52f46fda7"
/>
You will see other database entries already there.
Attached is a program which tests the entry:
mcs -pkg:dotnet TestFactory.cs
mono TestFactory.exe
Cheers, and thanks!
Chris.
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.6.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages libnpgsql2.2-cil depends on:
ii cli-common 0.9+nmu1
ii libmono-corlib4.5-cil 4.2.1.102+dfsg2-8
ii libmono-security4.0-cil 4.2.1.102+dfsg2-8
ii libmono-system-core4.0-cil 4.2.1.102+dfsg2-8
ii libmono-system-data4.0-cil 4.2.1.102+dfsg2-8
ii libmono-system-ldap4.0-cil 4.2.1.102+dfsg2-8
ii libmono-system-transactions4.0-cil 4.2.1.102+dfsg2-8
ii libmono-system4.0-cil 4.2.1.102+dfsg2-8
libnpgsql2.2-cil recommends no packages.
libnpgsql2.2-cil suggests no packages.
-- no debconf information
using System;
using System.Data;
using System.Data.Common;
namespace TestFactory
{
public class Program
{
const string PROVIDER_ORACLE = "System.Data.OracleClient";
const string PROVIDER_MYSQL = "MySql.Data.MySqlClient";
const string PROVIDER_PSQL = "Npgsql";
public static int Main( string[] args )
{
try
{
ListFactories();
TestFactory( PROVIDER_ORACLE );
// TestFactory( PROVIDER_MYSQL );
TestFactory( PROVIDER_PSQL );
}
catch( Exception ex )
{
Console.WriteLine( "..exception: " + ex.Message
);
}
return 0;
}
static void TestFactory( string name )
{
Console.WriteLine( "..test: {0}", name );
DbProviderFactories.GetFactory( name );
Console.WriteLine( " ..works" );
}
static void ListFactories()
{
Console.WriteLine( "..available factories:" );
DataTable dt = DbProviderFactories.GetFactoryClasses();
foreach( DataRow dr in dt.Rows )
{
foreach( DataColumn dc in dt.Columns )
{
Console.WriteLine( " {0}: {1}",
dc.ColumnName, dr[dc] );
}
Console.WriteLine();
}
}
}
}