microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Getting an Arg_GetMethNotFnd error with PageIterator when publishing project

Open
#2,944 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

When publishing my blazor wasm projet I am getting an Arg_GetMethNotFnd error when trying to use the PageIterator with a method that uses a generic method when publishing my project. I assume it is related to the trimming of the project.

Image

Image

Expected behavior

I expect that since the project works in localhost, for it to work when publishing the project

How to reproduce

Create a Blazor WASM project and use a generic method to use the page iterator, publish to project to an IIS server and try to use the page iterator

` public static async Task<IEnumerable> GetAllFromIterator<T, T2>(GraphServiceClient client, T2 collectionResponse) where T2 : IParsable, IAdditionalDataHolder, new()
{
var response = new List();

 var pageIterator = PageIterator<T, T2>.CreatePageIterator(client, collectionResponse,
     (tObject) =>
     {
         response.Add(tObject);
         return true;
     },
     (req) =>
     {
         req.Headers.Add("ConsistencyLevel", "eventual");
         return req;
     }
     );

 await pageIterator.IterateAsync();

 return response;

}`

SDK Version

5.83.0

Latest version known to work for scenario above?

No response

Known Workarounds

By removing the genric part of the method the page iterator works when publishing

Image

Debug output
Configuration

No response

Other information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. First reproduce the issue with a published Blazor WASM project using the generic PageIterator method, then inspect PageIterator.CreatePageIterator and the published trimming behavior. Done means the generic method works after publishing without Arg_GetMethNotFnd, while preserving the localhost behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.