Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: JsonSerializationException when trying to get current rate limits.

$
0
0
Hi,

I updated to version 0.9.9.5 using Nuget and tried to use the app-only authentication and see what the current rate limits were.

The credentials are set like this:
Auth.SetApplicationOnlyCredentials(_consumerKey, _consumerSecret, true);
And I'm trying to get the rate limit using
return RateLimit.GetCurrentCredentialsRateLimits();
When that executes, I get the following error:
Newtonsoft.Json.JsonSerializationException was unhandled by user code
  HResult=-2146233088
  Message=Error setting value to '_rateLimitContext' on 'Tweetinvi.Core.Interfaces.Models.TokenRateLimits'.
  Source=Newtonsoft.Json
  StackTrace:
       at Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.Serialization.JsonSerializerProxy.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
       at Tweetinvi.Logic.JsonConverters.JsonInterfaceToObjectConverter`2.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonConverter[] converters)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonConverter[] converters)
       at Tweetinvi.Logic.Wrapper.JsonConvertWrapper.DeserializeObject[T](String json, JsonConverter[] converters)
       at Tweetinvi.Logic.JsonConverters.JsonObjectConverter.DeserializeObject[T](String json, JsonConverter[] converters)
       at Tweetinvi.Credentials.TwitterAccessor.ExecuteGETQuery[T](String query, JsonConverter[] converters)
       at Tweetinvi.Controllers.Help.HelpQueryExecutor.GetCurrentCredentialsRateLimits()
       at Tweetinvi.Controllers.Help.HelpController.GetCurrentCredentialsRateLimits()
       at Tweetinvi.RateLimit.GetCurrentCredentialsRateLimits(Boolean useRateLimitCache)
       at MyApplication.TwitterData.TwitterDataSourcer.GetRateLimits() in TwitterDataSourcer.cs:line 46
  InnerException: System.NullReferenceException
       HResult=-2147467261
       Message=Object reference not set to an instance of an object.
       Source=Tweetinvi.Core
       StackTrace:
            at Tweetinvi.Core.Interfaces.Models.TokenRateLimits.set__rateLimitContext(JObject value)
            at Set_rateLimitContext(Object , Object )
            at Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
       InnerException: 
Should I be doing things differently? Any guidance would be greatly appreciated.

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>