Method not found Void Microsoft PowerBI Api V2 PowerBIClient ctor - Power BI Embedded

0 votes

 have a problem with Power BI Embedded. I want to embed a power BI report in a partial view. Following the guide, I created these methods on my controller:

public ActionResult Report()
    {
        credential = new UserCredential(username, passwordPowerBI);
        Authorize().Wait();

        ReportEmbed myReport = new ReportEmbed();

        using (var client = new PowerBIClient(new Uri(apiUrl), tokenCredentials))
        {
            EmbedToken embedToken = client.Reports.GenerateTokenInGroup(groupId, reportID, new GenerateTokenRequest(accessLevel: "View"));
            Report report = client.Reports.GetReportInGroup(groupId, reportID);

            myReport.reportID = reportID;
            myReport.embedURL = report.EmbedUrl;
            myReport.embedToken = embedToken.Token;
        }
        return PartialView(myReport);
    }

    private static Task Authorize()
    {
        return Task.Run(async () => {
            authenticationResult = null;
            tokenCredentials = null;
            var authenticationContext = new AuthenticationContext(authorityUrl);

            authenticationResult = await authenticationContext.AcquireTokenAsync(resourceUrl, clientID, credential);

            if (authenticationResult != null)
            {
                tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
            }
        });
    }

And in the view I just try to view my report. But the application go to this exception:

enter image description here

(sorry, some text is in italian. "Impossibile trovare il metodo" means "Method not found").

What is the problem? Something is missing in the web.config?

Mar 10, 2022 in Power BI by Edureka
• 13,630 points
495 views

1 answer to this question.

0 votes
There appears to be a version difference between the assemblies. It detects the proper assembly at compile time, but it loads an older version of the client at run time. Make sure you're using the correct assemblies in your deployment.
answered Mar 14, 2022 by gaurav
• 22,970 points

Related Questions In Power BI

0 votes
0 answers
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,570 points
793 views
+1 vote
1 answer

Is it possible to manage limits while using dedicated capacity power bi embedded app service?

These limits are not related to using ...READ MORE

answered Sep 24, 2018 in Power BI by Hannah
• 18,570 points
371 views
0 votes
2 answers

Embed Microsoft Power BI into Liferay

HI... Embed Microsoft Power BI into Liferay- I HOPE ...READ MORE

answered Jul 15, 2020 in Power BI by anonymous
1,273 views
0 votes
1 answer

Authenticate on an ASP.Net Forms Authorization website from a console app

Essentially, we need to record a regular ...READ MORE

answered Sep 20, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
394 views
0 votes
1 answer

How to cache data in a MVC application?

Reference the System.Web dll in your model ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,830 points
1,197 views
0 votes
1 answer

Embedding Power Bi Report Promise is not defined powerbi.js

IE does not yet support Promise. You ...READ MORE

answered Oct 30, 2018 in Power BI by Shubham
• 13,490 points
1,391 views
0 votes
1 answer

Power Bi Embedded Not working, Can't login with Master User

I figured it out, and I'll put ...READ MORE

answered Mar 14, 2022 in Power BI by gaurav
• 22,970 points
580 views
0 votes
1 answer

PowerBI Workspace not visible

Aside from double-checking that the person added ...READ MORE

answered Mar 14, 2022 in Power BI by gaurav
• 22,970 points
516 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP