Error connecting to Postgres database from UWP application

Bishoy

Trying to connect to a Postgres database from a UWP app using Npgsql and getting an error loading the following assembly:

"System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

And this is the exact exception:

{System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Npgsql.NpgsqlConnector.<RawOpen>d__139.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnector.<Open>d__136.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Npgsql.ConnectorPool.<AllocateLong>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Npgsql.NpgsqlConnection.<Open>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Npgsql.NpgsqlConnection.Open()
   at ... >>> here goes my code
Shay Rojansky

This is a known issue, see https://github.com/npgsql/npgsql/issues/820.

Unfortunately you'll have a few months until UWP supports netstandard20, at which point this will go away.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error connecting to Postgres database container

Error connecting to local MySQL database from spring boot application

Connecting to MYSQL database error (UWP C#)

Error while connecting postgres db from airflow

Error Connecting Azure Database from Thingworx

Error connecting Django to Google CloudSQL Postgres database in Google App Engine

Postgres ENOTFOUND error when connecting docker services to a docker database container

PHP - Connecting to heroku PostGres database from localhost (on Windows)

Connecting Database to Application with NameCheap

connecting database to flutter application

Failed to configure a DataSource: Intellij Error when connecting Database to Spring Application

Error connecting to SQLite database in Windows Phone 8.1 application

Django postgres database not connecting with Lumen

Hyperledger Iroha not connecting to postgres database?

'Self signed certificate' error during query the Heroku hosted Postgres database from the Node.js application

Connecting to an Existing Azure Database from an MVC application using Entity Framework

Connecting a db2 database from a centos hosted laravel application

Error when connecting to database

error connecting to database with mysqldriver

Error Connecting to database with PHP

Connecting database from flow

Connecting to external database - Android application

Error connecting to local Bitnami Docker Kafka from Spring Boot application

Error 80004005 when connecting to AD from Java application

Connecting to RDS Postgres from Heroku

Connecting the database of a desktop application with the database on another computer

Sequelize gets stuck connecting to heroku postgres database

Spring Batch - Problems Connecting to Postgres Database

App container not connecting properly to postgres database in deployment