microsoftgraph / microsoftgraph/msgraph-sdk-dotnet
Getting an Arg_GetMethNotFnd error with PageIterator when publishing project
Nobody has claimed this yet.
- 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.
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
Debug output
Configuration
No response
Other information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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