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

Method not found KiotaClientFactory.Create after upgrading Communications packages #774

Open
vidilab opened this issue Oct 10, 2024 · 10 comments

Comments

@vidilab
Copy link

vidilab commented Oct 10, 2024

Using PolicyRecordingBot, when upgrading Microsoft.Graph.Communications.* from (12.0.7270) to latest (1.2.0.10563), some adjustment in code are needed, but when that is done, there is an exception during startup. It seems to occur at BuildCommunicationsClientBuilder.Build().

System.MissingMethodException: 'Method not found: 'System.Net.Http.HttpClient Microsoft.Kiota.Http.HttpClientLibrary.KiotaClientFactory.Create(System.Net.Http.HttpMessageHandler)'.'

All packages are updated to latest with NuGet.

Microsoft.Graph.Core : 3.1.22
Microsoft.Graph : 5.60.0
Microsoft.Graph.Communications.* : 1.2.0.10563

The reason to upgrade is the bug fixes in the new version. Is there a way to use the new package versions? The reference project (CRFrontEnd.csproj) in github uses an even older outdated version:

<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.2.0.3742" />

@magnusdanielson
Copy link

Same problem here.

@stefan2410
Copy link

stefan2410 commented Oct 21, 2024

Same problem here.
.Net 4.8
Microsoft.Graph.Core : 3.1.14
Microsoft.Graph : 5.38.0
Microsoft.Graph.Communications.* : 1.2.0.10563

@vipwlb
Copy link

vipwlb commented Oct 21, 2024

https://github.com/microsoftgraph/microsoft-graph-comms-samples/pull/777/files

could you please try this one?

@vipwlb
Copy link

vipwlb commented Oct 21, 2024

also, could you share the exception details?
@vidilab @magnusdanielson

@stefan2410
Copy link

stefan2410 commented Oct 22, 2024

@vipwlb
in the Calls().OnIncoming += CallsOnIncoming.

System.MissingMethodException
  HResult=0x80131513
  Message=Method not found: 'System.Net.Http.HttpClient Microsoft.Kiota.Http.HttpClientLibrary.KiotaClientFactory.Create(System.Net.Http.HttpMessageHandler)'.
  Source=Microsoft.Graph.Communications.Calls
  StackTrace:
   at Microsoft.Graph.Communications.Calls.CommunicationsClientExtensions.<>c__DisplayClass0_0.<Calls>b__0()
   at Microsoft.Graph.Communications.Client.CommunicationsClient.GetOrAddResourceCollection[T](Boolean maintainState, Func`1 valueFactory)

In our environment
.Net 4.8
Microsoft.Graph.Core : 3.1.14

Its transitive dependencies

[Microsoft.IdentityModel.Protocols.OpenIdConnect](https://www.nuget.org/packages/Microsoft.IdentityModel.Protocols.OpenIdConnect/) (>= 8.0.1)
[Microsoft.Kiota.Abstractions](https://www.nuget.org/packages/Microsoft.Kiota.Abstractions/) (>= 1.9.11)
[Microsoft.Kiota.Authentication.Azure](https://www.nuget.org/packages/Microsoft.Kiota.Authentication.Azure/) (>= 1.9.11)
[Microsoft.Kiota.Http.HttpClientLibrary](https://www.nuget.org/packages/Microsoft.Kiota.Http.HttpClientLibrary/) (>= 1.9.11)
[Microsoft.Kiota.Serialization.Form](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Form/) (>= 1.9.11)
[Microsoft.Kiota.Serialization.Json](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Json/) (>= 1.9.11)
[Microsoft.Kiota.Serialization.Multipart](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Multipart/) (>= 1.9.11)
[Microsoft.Kiota.Serialization.Text](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Text/) (>= 1.9.11)
[System.Net.Http.WinHttpHandler](https://www.nuget.org/packages/System.Net.Http.WinHttpHandler/) (>= 6.0.0 && < 9.0.0)

With the dependencies of Microsoft.Graph.Communications.Core 1.2.0.10563 to Graph.Core (>= 3.1.3 && < 4.0.0)
and the dependencies of Microsoft.Graph.Communications.Core 1.2.0.10563 to Kiota.

[Microsoft.Kiota.Abstractions](https://www.nuget.org/packages/Microsoft.Kiota.Abstractions/) (>= 1.7.2)
[Microsoft.Kiota.Authentication.Azure](https://www.nuget.org/packages/Microsoft.Kiota.Authentication.Azure/) (>= 1.1.2)
[Microsoft.Kiota.Http.HttpClientLibrary](https://www.nuget.org/packages/Microsoft.Kiota.Http.HttpClientLibrary/) (>= 1.3.3)
[Microsoft.Kiota.Serialization.Form](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Form/) (>= 1.1.1)
[Microsoft.Kiota.Serialization.Json](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Json/) (>= 1.1.2)
[Microsoft.Kiota.Serialization.Multipart](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Multipart/) (>= 1.1.1)
[Microsoft.Kiota.Serialization.Text](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Text/) (>= 1.1.1)

we got other exception, (see below) .
in the Calls().OnIncoming += CallsOnIncoming.

MissingMethodException: Method not found: 'System.String Std.UriTemplate.Expand(System.String, System.Collections.Generic.Dictionary 2<System.String,System.Object>).

So we updated to Microsoft.Graph.Core : 3.1.14 and we got the exception first mentioned in my comment.

@magnusdanielson
Copy link

also, could you share the exception details? @vidilab @magnusdanielson

I have the same exception as @stefan2410

in the Calls().OnIncoming += CallsOnIncoming.

System.MissingMethodException
  HResult=0x80131513
  Message=Method not found: 'System.Net.Http.HttpClient Microsoft.Kiota.Http.HttpClientLibrary.KiotaClientFactory.Create(System.Net.Http.HttpMessageHandler)'.
  Source=Microsoft.Graph.Communications.Calls

As far as I can see the problem is in the Calls() method. The strange thing is that if I copy the code from the Calls() method and create my own Callsz() method with just the call to the factory, I dont get the error.

public static void Callsz(this ICommunicationsClient client, bool maintainState = true)
        {
            HttpClient httpClient = KiotaClientFactory.Create((HttpMessageHandler)null);
        }

@bfany365
Copy link

May be this can help ?

microsoftgraph/msgraph-sdk-dotnet#2694

@stefan2410
Copy link

stefan2410 commented Oct 23, 2024

@bfany365 with Microsoft.Graph.Core, 3.1.3
we should add Std.UriTemplate 0.048 to the nuget packages in order to work.
Now our problem is what to do with our other libraries using higher versions of Graph.Core
(our other libraries use 3.1.4 which has dependencies to Kiota 1.9.1.1. )
For testing purposes, we isolated them.

@vidilab
Copy link
Author

vidilab commented Oct 25, 2024

also, could you share the exception details? @vidilab @magnusdanielson

I also have the same exception details as stefan2410

@vipwlb
Copy link

vipwlb commented Oct 26, 2024

A known issue was reported that found interaction of Graph Communications SDK nugets with Graph Core version 3.1.22. Graph.Core's internal Kiota lib dependency are conflicting with the Graph Commmunications Call SDK internal dependency. This is causing runtime issues so kindly refrain from Graph.Core version upgrades if using Graph Communications Calls nuget packages.
the issue is not with Graph Core directly but with Graph Core's dependency on Kiota lib

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

No branches or pull requests

5 participants