我正在使用api twitterizer.framework 在获取用户的朋友时,api开始抛出此错误。
# 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
如何处理?
答案 0 :(得分:0)
这是一个已知问题,但不会更正。 Twitterizer库的版本1. *已被放弃,因为6月之后Twitter将不再支持BASIC身份验证(这意味着您的版本将不再起作用)。
请下载Twitterizer 2的测试版。
如果您希望自己解决问题,则问题与将配置文件颜色代码解析为int值有关。它们应该更改为字符串值而不进行解析。
Ricky(Twitterizer作者)