This topic is locked
[SOLVED]

The type or namespace name 'Npgsql' could not be found

5/17/2025 12:17:16 PM
ASPRunner.NET General questions
S
Simon Ward author

Fresh project in both v10 & v11 using Postgres database hosted in AWS.
1 table with id (primary key) and text field.
Trying to turn on encryption (database level - also tried code level) and during compile I get the following error.

Classes\ConnectionsPool.cs(8,7): error CS0246: The type or namespace name 'Npgsql' could not be found (are you missing a using directive or an assembly reference?) [C:\Projects\Project1\output\Project1.csproj]

Anyone got any hints/tips how to resolve?

TIA

S
Simon Ward author 5/17/2025

Update:

Turning off encryption in v10 I get the same issue at compile, making me think it is an issue with Postgres being used as the database connection (especially as it references the connectionPool class). I normally use MS SQL as my database platform so assumed Postgres would be fully compatible/integrated.

I can confirm that Postgres works on my machine as I have pg4Admin which I use to connect to other Postgres databases.

Sergey Kornilov admin 5/23/2025

Proceed to the Output folder screen and select .NET Framework 4.5 there. Unfortunately, there is no PostgreSQL driver for framework 4.8.