Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Safwan
Helper I
Helper I

Error connecting Postgres to PowerBI desktop

Hi,

 

I am trying to connect my PowerBI desktop app to Postgres database and I am getting the following error:

An error happened while reading data from the provider: Could not load file or assembly "System.Runtime.CompilerServices.Unsafe. Version 4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

 

image (1).png

 

 

 

1 ACCEPTED SOLUTION
mohitkumawat
Super User
Super User

Hi,

Please try and check the below things 

1) Install latest gateway (if not already installed)

2) Install PostgreSQL driver

3) Create a data source for PostgreSQL in gateway

4) Map data source to Dataset in the dataset settings page
In short, you have to install latest  version of NpgSQL and when installing, select the NpgSQL GAC option. The article I linked has a more detailed step-by-step guide.
https://powerbipoint.com/2024/01/22/fix-power-bi-refresh-error-could-not-load-file-or-assembly-or-on...

View solution in original post

1 REPLY 1
mohitkumawat
Super User
Super User

Hi,

Please try and check the below things 

1) Install latest gateway (if not already installed)

2) Install PostgreSQL driver

3) Create a data source for PostgreSQL in gateway

4) Map data source to Dataset in the dataset settings page
In short, you have to install latest  version of NpgSQL and when installing, select the NpgSQL GAC option. The article I linked has a more detailed step-by-step guide.
https://powerbipoint.com/2024/01/22/fix-power-bi-refresh-error-could-not-load-file-or-assembly-or-on...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors