This project has moved and is read-only. For the latest updates, please go here.

Input string was not in a correct format.

Mar 1, 2008 at 9:48 PM

I occasionally get the error below out of the blue. Sometimes its gone after 10 mins, sometimes it goes on for hours. Any suggestions as to what the problem might be?

Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

Line 27:
Line 28: Flickr f = new Flickr(apiKey, sharedSecret);
Line 29: Photos set1 = f.InterestingnessGetList(DateTime.Today.AddDays(-1), PhotoSearchExtras.None, 500, 1);
Line 30: Photos set2 = f.InterestingnessGetList(DateTime.Today.AddDays(-2), PhotoSearchExtras.None, 500, 1);
Line 31:

Source File: d:\hosting\cfarrugia\Default.aspx.cs Line: 29

Stack Trace:

FormatException: Input string was not in a correct format.
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2725283
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
System.Xml.XmlConvert.ToInt32(String s) +100
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read7_Photo(Boolean isNullable, Boolean checkType) +978
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read8_Photos(Boolean isNullable, Boolean checkType) +788
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read42_Response(Boolean isNullable, Boolean checkType) +684
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read43_rsp() +73

InvalidOperationException: There is an error in XML document (289, 62).
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +637
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) +32
System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) +160
FlickrNet.Utils.Deserialize(String responseString) +67

ResponseXmlException: Invalid response received from Flickr.
FlickrNet.Utils.Deserialize(String responseString) +152
FlickrNet.Flickr.GetResponse(Hashtable parameters, TimeSpan cacheTimeout) +595
FlickrNet.Flickr.GetResponseCache(Hashtable parameters) +42
FlickrNet.Flickr.InterestingnessGetList(DateTime date, PhotoSearchExtras extras, Int32 perPage, Int32 page) +266
_Default.GetSquareThumbs() in d:\hosting\cfarrugia\Default.aspx.cs:29
ASP.defaultaspx._Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\hosting\cfarrugia\Default.aspx:133
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2113547
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896

Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
Apr 19, 2010 at 10:40 PM

Did this ever get resolved. I am having the same issue.


Apr 21, 2010 at 10:28 AM

Can you ensure you are using the latest version of the FlickrNet dll.

If you are still having this issue then please leave details of the code you are using and which methods you are calling.