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

Fixed a MissingMethodException by updating Microsoft.Kiota.Http.HttpClientLibrary #131

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

maurice-freitag
Copy link
Contributor

Hi @NikiforovAll, could you please take a look at this? There is an issue with the current version of Kiota, causing a MissingMethodException (KiotaClientFactory.CreateDefaultHandlers()) when using your library which I was able to resolve by updating the package references. See also microsoftgraph/msgraph-sdk-dotnet#2533

@maurice-freitag
Copy link
Contributor Author

I updated all Kiota packages to resolve another issue:

 Error while processing request.
      System.Exception: IAsyncParseNodeFactory factory is required
         at Microsoft.Kiota.Abstractions.Serialization.ParseNodeFactoryRegistry.GetFactory[T](String contentType)
         at Microsoft.Kiota.Abstractions.Serialization.ParseNodeFactoryRegistry.GetRootParseNodeAsync(String contentType, Stream content, CancellationToken cancellationToken)
         at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.GetRootParseNode(HttpResponseMessage response, CancellationToken cancellationToken)
         at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendCollectionAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
         at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendCollectionAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
         at Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Users.Item.Groups.GroupsRequestBuilder.GetAsync(Action`1 requestConfiguration, CancellationToken cancellationToken)

I used the exact same versions as referenced by the current Microsoft.Graph package (5.56.0) as those seem to work. I honestly don't understand what Microsoft were doing when they versioned those packages. Microsoft.Kiota.Http.HttpClientLibrary is already published in version 1.11 which not even their Graph library uses. I think sticking to these versions should be relatively safe but if you'd like I could test the newest versions as well.

@maurice-freitag
Copy link
Contributor Author

I just realized that the version here mirrors the Keycloak version it's supposed to work with. 25.0.1 would be wrong in this case.

  • we could keep this at 25.0.0 and you could overwrite the published NuGet package, risky and difficult to maintain for depending projects
  • leave this version broken and advise people to upgrade when feat: update kiota api to 25.0.2 #129 is done
  • use 25.0.0-hotfix.1, this would be considered a pre-release version, users would have to update manually

Please let me know how (if) you would like to proceed

@NikiforovAll
Copy link
Owner

NikiforovAll commented Aug 19, 2024

Could you please undo the changes to keycloak version? we can go with a prerelease version with some prefixes. the versioning strategy is not the best for this scenario

I think it is a <Suffix>hotfix.1<Suffix/> or <VersionSuffix>

@maurice-freitag
Copy link
Contributor Author

Could you please undo the changes to keycloak version? we can go with a prerelease version with some prefixes. the versioning strategy is not the best for this scenario

I think it is a <Suffix>hotfix.1<Suffix/> or <VersionSuffix>

Done. I had to use <VersionPrefix> instead of <Version> as the latter overwrites any pre- and suffixes

@NikiforovAll NikiforovAll merged commit 3933381 into NikiforovAll:main Aug 19, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants