apitwitterizer

twitter api is throwing exception "# is not a valid value for Int32" while getting friends


I am using the api twitterizer.framework while getting the friends of a user the api starts throwing this error.

# is not a valid value for Int32. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
   at System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos)
   at System.Convert.ToInt32(String value, Int32 fromBase)
   at System.ComponentModel.Int32Converter.FromString(String value, Int32 radix)
   at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   --- End of inner exception stack trace ---
   at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
   at System.Drawing.ColorConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.ComponentModel.TypeConverter.ConvertFromString(String text)
   at System.Drawing.ColorTranslator.FromHtml(String htmlColor)
   at Twitterizer.Framework.TwitterRequest.ParseUserNode(XmlNode element) in C:\Projects\twitterizer\Twiterizer.Framework\TwitterRequest.cs:line 514
   at Twitterizer.Framework.TwitterRequest.ParseUsers(XmlElement element) in C:\Projects\twitterizer\Twiterizer.Framework\TwitterRequest.cs:line 483
   at Twitterizer.Framework.TwitterRequest.ParseResponseData(TwitterRequestData data) in C:\Projects\twitterizer\Twiterizer.Framework\TwitterRequest.cs:line 305

how to handle this?


Solution

  • This is a known issue, but it will not be corrected. Version 1.* of the Twitterizer library has been abandoned, since BASIC authentication will no longer be supported by Twitter after June (which means the version you have will no longer function).

    Please download the beta of Twitterizer 2.

    If you would prefer to fix the issue yourself, the problem relates to parsing profile color codes to int values. They should be changed to string values and not parsed.

    Ricky (Twitterizer Author)