When working with PowerBI Desktop, you can encounter various error messages, which usually put you on the right track explaining what you’re doing wrong.

However, there is also another category of error messages, which seem to propagate from the more darker regions of the software, which you can’t really understand what went wrong. I will list two of those which I came across a couple of times, but for which the internet didn’t provide a solution.

For the search engines, let’s list the errors received:

  • Cannot deserialize the current JSON object (e.g. {“name”:”value”}) into type ‘System.Collections.Generic.IReadOnlyDictionary`2[System.String,Microsoft.PowerBI.Packaging.Storage.ConceptualSchemaSettingsStorage]’ because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly
  • Cannot perform interop call to: dataExploreHost_modelingServiceHostService.ExecuteDataQueries
  • Cannot perform interop call to: MinervaDialogHost_modelingServiceHostService.ExecuteDataQueries (args:1) – wrong arg[0]=dataQueries value { “queries”: …

Environment

All the above errors occurred using the PowerBI Desktop July edition, but also previous editions, going back to December 2023 running on Windows 11 (22631)

Replicate

The first error “Cannot deserialize the current JSON object” happened to me when opening a PBIT file. Any run-of-the-mills PBIT, like the one I downloaded from Microsoft’s github : PowerBI-LogAnalytics-Template-Reports/PBIASEngine/README.md at main · microsoft/PowerBI-LogAnalytics-Template-Reports · GitHub or even a PBIT that I made myself in the same version of PowerBI Desktop.
Surely there could be other circumstances in which this appears, but this was the one that blocked me for a long time.

The second error “Cannot perform interop call to: …” occured on three occasions:

  • In PowerBI Desktop, in the model view, double-click on a relationship in your model. The error message “Cannot perform interop call to: MinervaDialogHost_modelingServiceHostService.ExecuteDataQueries” is displayed after which the normal dialog box is shown.
  • In PowerBI Desktop, in the table view, try to mark a table as a Date table, select “On” and the date column, after which “Cannot perform interop call to: MinervaDialogHost_modelingServiceHostService.ExecuteDataQueries.” error occurs
  • In PowerBI Desktop, in the table view, try to select a column and select “sort by column”, which shows the “Cannot perform interop call to: dataExploreHost_modelingServiceHostService.ExecuteDataQueries” error.

Investigation

Initially, I tried to exhaust the internet for solutions, as this must be something affecting not only myself. The “Cannot deserialise” error seem to have been reported a few times, but the proposed solution was very cumbersome. It involved unzipping the PBIX file, opening a file in there, removing part of that file, etc… which didn’t prove to be a solution for me, and also seems very tedious and unsupported when sharing that file with others. This can’t be the “normal” fix for this error.

The second error was almost not reported, and I couldn’t find any way to address this issue.

Solution

Both errors seem to have the same root cause: PowerBI Desktop was loading a DLL from the Global Assembly Cache (GAC), rather then using the DLL that came with the product from the local cache.

The incompatible DLL can be found in C:\Windows\Microsoft.NET\assembly\GAC_MSIL in the directory Newtonsoft.Json

After closing PowerBI Desktop, this directory can be safely removed (as an admin), but I’d advise you to keep a backup of it when doing so.
Doing so forces PowerBI Desktop to look for the DLL in the local cache.

What could go wrong

When trying to move the Newtonsoft.Json directory out of the GAC, the action could be denied as other processes might have handles on these DLLs.

Surely, you should have PowerBI Desktop shut down. But even then, other software can use this. E.g. Redgate Client seems to rely on it, as well as Intune.

To identify which other processes use it, open the Windows Resource Monitor.

In the tab CPU, select all processes and go to the section Associated Handles. There you can search for Newtonsoft, which will list all software having Newtonsoft in their path name.

If the Handle Name points to a file in the above directory C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Newtonsoft.Json\ then the process is using it.

Stop the process, by closing the application, stopping the service or worst case using pskill (PsKill – Sysinternals | Microsoft Learn ) and then you’ll be able to move the directory out.