-
Notifications
You must be signed in to change notification settings - Fork 14
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
Getting Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path 'userPurpose' in the Demo project. #43
Comments
@spartan1047 sorry you're having trouble! This seems to be an issue with the very old version of the Graph SDK that the (deprecated) Microsoft.Toolkit.Graph.Controls package. The I suspect the answer here will be to replace Microsoft.Toolkit.Graph.Controls with CommunityToolkit.Graph.Uwp. I'm not sure how much effort that entails at this point, but I'll take a look ASAP. |
Microsoft.Toolkit.Graph.* is deprecated, the recommended replacement is CommunityToolkit.Graph. Fixes #43
@jasonjoh Hello, thanks for the commit, I have downloaded the changes but still not working, in Windows 10, after I type my password nothing happens. In Windows 11, I'm getting an error: |
Oh yes, sorry! This is an issue with the new toolkit (see CommunityToolkit/Graph-Controls#188). For now add the redirect URI the error is showing you to your app registration (under Authentication). |
Better solution: // Configure MSAL provider
var msalClient = PublicClientApplicationBuilder.Create(appId)
.WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient")
.Build();
ProviderManager.Instance.GlobalProvider = new MsalProvider(msalClient, scopes.Split(' ')); Commit incoming. |
I don't reproduce it with either a personal account or a work/school account. I do see these GitHub issues: |
Where did you get the code?
Describe the bug
Is not possible to get the MailboxSettings with the projects as it is. If you run the project you get a Newtonsoft.Json.JsonReaderException, this happen following the tutorial o downloading the demo project from github, in both cases I have replaced the AppID with my own id.
To Reproduce
Steps to reproduce the behavior (for the demo):
Expected behavior
I'm expecting to see the calendar as the tutorial and documentation indicates.
Screenshots
Desktop (please complete the following information):
Dependency versions
Additional context
Exception output:
Newtonsoft.Json.JsonReaderException
HResult=0x80131500
Mensaje = Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path 'userPurpose', line 1, position 492.
Origen = Newtonsoft.Json
Seguimiento de la pila:
en Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
en Microsoft.Graph.DerivedTypeConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target)
en Microsoft.Graph.DerivedTypeConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target)
en Microsoft.Graph.DerivedTypeConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
en Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
en Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
en Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
en Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
en Microsoft.Graph.Serializer.DeserializeObject[T](String inputString)
en Microsoft.Graph.ResponseHandler.d__2
1.MoveNext() en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) en Microsoft.Graph.BaseRequest.<SendAsync>d__34
1.MoveNext()en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
en Microsoft.Graph.UserRequest.d__6.MoveNext()
en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
en System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
en GraphTutorial.CalendarPage.d__2.MoveNext() en C:\Users\Alienware Alpha\source\repos\GraphTutorial\GraphTutorial\CalendarPage.xaml.cs: línea 52
Esta excepción se generó originalmente en esta pila de llamadas:
[Código externo]
GraphTutorial.CalendarPage.OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs) en CalendarPage.xaml.cs
The text was updated successfully, but these errors were encountered: