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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
LinqLover
Frequent Visitor

Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=ne

Hi,

 

we have about a dozen of dashboards in our PBI app whose dashboards are scheduled to be updated every night. The datasets are connected to a self-hosted Postgres database. Since last night, the datasets cannot be updated any longer in Power BI Online, whereas updating the reports locally in Power BI Desktop works fine.

This is the error message we get when updating a dataset automatically or manually in PBI Online:

 

<report name> has failed to refresh.

Failure details: The last refresh attempt failed because of an internal service error. This is usually a transient issue. If you try again later and still see this message, contact support.

Processing error: An error happened while reading data from the provider: 'Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, 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)'
Cluster URI: WABI-WEST-EUROPE-D-PRIMARY-redirect.analysis.windows.net
Activity Id: d2829b9e-f382-460c-9cdd-0c1545d61ad7
Error: {"error":{"code":"ModelRefresh_ShortMessage_ProcessingError","pbi.error":{"code":"ModelRefresh_ShortMessage_ProcessingError","parameters":{},"details":[{"code":"Message","detail":{"type":1,"value":"An error happened while reading data from the provider: 'Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, 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)'"}}],"exceptionCulprit":1}}}

 

Why did this break, and how can we solve this? I found some similar issues [1, 2, 3] where the solution seemed to be downgrade npgsql from v4.* to v3.*. However, how can we modify the installation of the PBI Server, which is not self-hosted afaik? Did someone from Microsoft install some bad updates on the server cluster?

 

Looking forward to your help!

 

Best,

Christoph

 

PS: The issue apparently affects both imported tables and DirectQueries.

 

[1] https://community.powerbi.com/t5/Desktop/a-problem-connecting-wiht-postgresql-database/td-p/431097

[2] https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?MessageKey=ae6ff321-...

[3] https://github.com/npgsql/npgsql/issues/2677

8 REPLIES 8
PakthurYangu
Helper I
Helper I

I wasted a few days looking for a solution until I came across this article.

In short, you have to install version 4.0.10 of NpgSQL and when installing, select the NpgSQL GAC option. The article I linked has a more detailed step-by-step guide.

LinqLover
Frequent Visitor

Hi,

 

this issue seemed to had resolved by itself a long time ago, but today it occured again after I reuploaded all our existing reports again (just to reenter our changed database password). After that, refreshing the datasets online does not work any longer! We are hosting PostgreSQL on our own VM, by the way, if this matters. Did anybody find a workaround for this?

 

Activity ID for support is d3e145d3-3cc2-4c5f-a9e4-02a58ebe7d55.

 

Best,

Christoph

nebulus
Frequent Visitor

Similar happened in November 2020 and it took several days from Microsoft to fix. Does this only happen with Azure PostgreSQL databases?

 

November 2020 this was reported as know issue but at the moment it is not yet:

https://powerbi.microsoft.com/en-us/support/

 

nebulus_0-1630044616042.jpeg

 

Workaround that they listed in November 2020 did not help. We tried all of this with help from Microsoft support. We started our conversation 11th of Nov and the last one was 24th of Nov when the issue was fixed.

 

It seems that you need to refresh your data manually using desktop files and publish them again.

Anonymous
Not applicable

Yup! Same thing here!
Got emails from all my reports, all within 6 minutes:

An error occurred while processing the data in the dataset.

Refresh failed:

ReportName has failed to refresh.
Failure details: 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)'

Next refresh for ReportName is scheduled for August 27, 2021 21:00 UTC.

Anonymous
Not applicable

I refreshed my data manually using PBI Desktop and published it again. All went fine.

Now, when I go to PBI Service, I still see the scheduled refresh error and I have to re-enter my credentials. After updating my credentials I again get the same error (mentined in my last post):

20210902@12h06m20s_PowerBIServiceDatasetUpdateFail_CouldNotLoadFileOrAssembly.png

 

I can log into the Azure Postgre database (with pgAdmin) using the credentials I provided earlier to PBI Service, so they seem to be OK.
What's going on? Is it me or Microsoft?

I am having a similar issue, anyone with a solution?

 

Processing 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)'

ysanabria
Frequent Visitor

I'm having the same issue, any solution for this?

 

 

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)'

Anonymous
Not applicable

Im facing exactly the same issue.

 

Using Azure PostgreSQL!

See also this post: https://community.powerbi.com/t5/Service/Could-not-load-file-or-assembly-System-Runtime-CompilerServ...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors