Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

.NET PowerBIClient NuGet Package adds wrong relative URI

$
0
0

I try to encapsule our PowerBI Server REST API via the PowerBI Client NuGet Package from Microsoft.I ran into the problem that the URI gets a wrong relative path added.The REST API of our Reporting Server (on-premise) has a base URI like: https://niceReportingURL.com/reports/api/v2.0 but the NuGet package adds another "/v1.0/myorg" to the URI, which is not necessary.

So resulting of that, the request URI looks like this: https://niceReportingURL.com/reports/api/v2.0/v1.0/myorg

I saw in the source code of the class "ReportsOperations" that this weird relative URI gets added hardcoded!

string uriString = new Uri(new Uri(absoluteUri + (absoluteUri.EndsWith("/") ? "" : "/")), "v1.0/myorg/reports").ToString();

I omitted the "/Reports" in my example URIs because it looks like a general problem.Is there an option or workaround that the NuGet Package doesn't add this relative URI?

The request looks like this:

var c = new BasicAuthenticationCredentials        {            UserName = "reportingUser",            Password = "secretReportingPW"        };var client = new PowerBIClient(new Uri("https://niceReportingURL.com/reports/api/v2.0"), c);var result = await client.Reports.GetReportsAsync().ConfigureAwait(false); // Here comes the fail

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>