Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageIterator.CreateIterator missing method since v5.34 #2226

Closed
dawidgrey opened this issue Nov 20, 2023 · 3 comments
Closed

PageIterator.CreateIterator missing method since v5.34 #2226

dawidgrey opened this issue Nov 20, 2023 · 3 comments

Comments

@dawidgrey
Copy link

The PageIterator worked in v5.33 and stopped working in v5.34, including v5.35.

All my code that uses the PageIterator fails. Here is an example:

public async Task<List<AadUserModel>> GetAllUsers()
{
    var response = await _client.Users.GetAsync();
    var results = new List<AadUserModel>();

    var pageIterator = PageIterator<Microsoft.Graph.Models.User, UserCollectionResponse>
        .CreatePageIterator(_client, response, (u) =>
        {
              results.Add(new AadUserModel
              {
                  AzureId = Guid.Parse(u.Id),
                  DisplayName = u.DisplayName,
                 //... 
              });

            return true;
        });

    await pageIterator.IterateAsync();

    return results;
}

Unexpected error

System.MissingMethodException
  HResult=0x80131513
  Message=Method not found: 'Microsoft.Graph.PageIterator`2<!0,!1> Microsoft.Graph.PageIterator`2.CreatePageIterator(Microsoft.Graph.IBaseClient, !1, System.Func`2<!0,Boolean>, System.Func`2<Microsoft.Kiota.Abstractions.RequestInformation,Microsoft.Kiota.Abstractions.RequestInformation>)'.
 
@andrueastman
Copy link
Member

Thanks for raising this @dawidgrey

Any chance you are able to share the NET runtime you are using to build your app when this error occurs? Any chance you've also tried clearing you nuget cache as well on rebuilding?

@Charlie-Conte
Copy link

I have the same problem. both on local and on azure pipelines CICD.
Nuget cashes cleared and refreshed on every build.
using .Net 7

image
Hope this helps

@dawidgrey
Copy link
Author

v5.36.0 is working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants