-
Notifications
You must be signed in to change notification settings - Fork 252
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
Error when trying to list Authentication Methods #2260
Error when trying to list Authentication Methods #2260
Comments
Thanks for raising this @jermifer The baseUrl used in the request does not look correct |
Thanks for the quick response. There is no packet for the Graph call. The capture I provided is from the calling app. The error must be occurring in the library before the code goes out to the API...? I just noticed, another piece of code that we already have in production (using the older version of the Graph library) is no longer working in test. Same error:
I rolled back my changes, and I am still getting the same error, even with the Microsoft.Graph 5.31 and Microsoft.Graph.Core 3.0.11 libraries. It wasn't until I rolled back to Microsoft.Graph 5.10.0 and Microsoft.Graph.Core 3.0.6 that the |
Just a note: even with |
Upon further inspection, the problem appears to be with the Std.UriTemplate NuGet package. I have tried both versions 0.0.46 and 0.0.49. In my working code, that package does not exist. Newer versions of Microsoft.Kiota.Abstractions depend on it. In the working code, 1.1.1 is installed. In the broken code, I have tried both 1.7.3 and 1.7.2. At least, best I can surmise at this point. Hopefully it helps. |
Out of curiosity are you able to run the following in the latest version? Any chance the URI has the expected base url? var requestInfo = graphClient.Users["user-id"].Authentication.TemporaryAccessPassMethods.ToPostRequestInformation(requestBody);
Console.WriteLine(requestInfo.URI.OriginalString); |
Hello, Trying to run the code you requested throws the same exception. BTW, I just discovered that Std.UriTemplate 0.0.48 works. 0.0.49 and 0.0.46 do not. Thanks, Jen |
Thank You so very much! |
Changes between v0.0.48 and v0.0.49 don't seem to point to an issue std-uritemplate/std-uritemplate@v0.0.48...v0.0.49. Out of curiosity are you specifying the package versions in your @GHV393 Any chance you can share your runtime information? Are you also running on net framework 4.8? |
I'm running on Framework 4.6.2. When I changed from 0.0.49 to 0.0.48, I no longer have the issue. |
I've been struggling with the same issue for hours. Glab to came across this thread, thanks :) |
I had the same issue in a .NET 4.8.1 web application when utilizing the MS Graph SDK v5 and trying to fetch the user profile. Quickly setup a console application which then worked. Checked the version numbers for Std.UriTemplate and Microsoft.Kiota.Authentication.Azure and found that the new console application was running with different version numbers than the web application which was updated to lastest versions. So try using the following versions:
This solved the issue for me. |
I had the same problem in a .NET 4.8.1 winforms application using MS Graph 5.37 when fetching MailFolders. |
Hello, I'm not entirely sure about the second part of what you are asking. The csproj file does specify the package version. I noticed that the Extend method signature for 0.0.48 uses a Dictionary as the second param type, but 0.0.49 uses IReadOnlyDictionary. That seems to be what the code is hung up on (error is "Method not found: 'System.String Std.UriTemplate.Expand(System.String, System.Collections.Generic.Dictionary`2<System.String,System.Object>)'"). |
Please provide the following (and please check them off the list with [x]) before submitting this issue:
I am getting an exception when trying to call
graphClient.Users[userPrincipalName].Authentication.Methods.GetAsync()
Expected behavior
Should return a AuthenticationMethodCollectionResponse according to the code insight in Visual Studio. Originally used documentation here: https://learn.microsoft.com/en-us/graph/api/authentication-list-methods?view=graph-rest-1.0&tabs=csharp#examples
Actual behavior
Throws System.MissingMethodException: Method not found: 'System.String Std.UriTemplate.Expand(System.String, System.Collections.Generic.Dictionary`2<System.String,System.Object>)'.
Stack Trace
Request
Response
Steps to reproduce the behavior
I'm working in Microsoft Visual Studio Professional 2022 (64-bit) - Current, Version 17.8.2, but the error occurs on the test server. App is built in .NET Framework 4.8 MVC 5.3. I'm using Microsoft.Graph 5.37.0.0 and Microsoft.Graph.Core 3.1.3.0.
The text was updated successfully, but these errors were encountered: