Reputation: 11
I can use C# and NpgSQL to connect to a PostgreSQL 12 instance. However when I use the same exact code to connect to a PostgreSQL 11 instance I get an exception. Object reference not set to an instance of an object. This is from line 1708 of NpgsqlConnector.cs (from disassembly).
The packages in my solution are as follows:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" targetFramework="net471" />
<package id="Npgsql" version="4.1.3.1" targetFramework="net471" />
<package id="System.Buffers" version="4.5.0" targetFramework="net471" />
<package id="System.Memory" version="4.5.3" targetFramework="net471" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net471" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net471" />
<package id="System.Text.Encodings.Web" version="4.6.0" targetFramework="net471" />
<package id="System.Text.Json" version="4.6.0" targetFramework="net471" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net471" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />
<package id="Teradata.Client.Provider" version="16.20.9" targetFramework="net471" />
</packages>
Upvotes: 0
Views: 387
Reputation: 11
Unfortunately it was mostly my lack of experience with PostgreSQL. I was lacking a pg_hba.conf entry for the machine I was trying to connect from. The error message was NOT very helpful...
Upvotes: 1