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,690 points
1,413 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.

Unlock the Power of Data Visualization with Our Comprehensive Power BI Course!

answered Mar 14, 2022 by gaurav
• 23,260 points

Related Questions In Power BI

+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,520 points
1,492 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,520 points
705 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
2,083 views
0 votes
3 answers

How do I get token using javascript API while trying to embed graphs using Power BI

Use ADAL.js that will give you an ...READ MORE

answered Jun 22, 2019 in Power BI by anonymous
4,562 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
911 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,833 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
2,060 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 2, 2022 in Power BI by gaurav
• 23,260 points
820 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
• 23,260 points
1,442 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