Hazel

This fixture creates an object with the same structure as an API response object. Here we’re using requests_mock.get to pass in the parameters we want (there are more options besides for url, json and status_code) and return the response object.

This is a usage example. The fixture mock_response…

--

--

Photo by Windows on Unsplash

This is a very common error that crops up when trying to use Microsoft’s AdomdConnection.

Assuming your connection string is valid (syntax can be viewed in Microsoft’s docs), and the Microsoft.AnalysisServices.AdomdClientnamespace is referenced in your project, the problem may be that you’re referencing theAdomdClient.dll file from the wrong directory.

To check where the dll file is being referenced:

  1. In Visual Studio, go to Project > Add Reference… > Browse
  2. Find Microsoft.AnalysisServices.AdomdClient.dll and check its path.

If the path begins with C:\Program Files, it’s likely the wrong dll file.

To update the file:

  1. In Visual Studio, go to Project > Add Reference… > Browse
  2. Click Browse… and navigate to C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.AnalysisServices.AdomdClient\v4.0_15.0.0.0))89845dcd8080cc91\Microsoft.AnalysisServices.AdomdClient.dll

Now, when running:

AdomdConnection conn = new AdomdConnection();

conn.ConnectionString = “Data Source=powerbi://api.powerbi.com/v1.0/myorg/Sales Work;UID=bi.sales@salesworkspace.com;PWD=Password123!;”;

conn.Open();

It should connect successfully.

--

--

Hazel

Hazel

Developer with imposter syndrome. Well, I wouldn't call myself a developer... Um, a messer-arounder in VSCode? 🥴 And coffee. Coffee’s important.

Following