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

Input string was not in a correct format.

Topics: Developer Forum
Jan 22, 2012 at 12:39 AM
Edited Jan 22, 2012 at 12:41 AM


I noticed that you mentioned this was fixed in the past, but I am seeing it for newly uploaded images. It appears that this error is happening because of
a value that is not filled in for a tag machine code.

      <tag id="72545215-6737552605-97" author="72550555@N05" raw="wood" machine_tag="">wood</tag>
      <tag id="72545215-6737552605-36657" author="72550555@N05" raw="past" machine_tag="">past</tag>


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 36:         For Each p as Photo in searchResults.PhotoCollection

Line 37:             

Line 38:             Dim photoInfo As PhotoInfo = flickr.PhotosGetInfo(p.PhotoId)

Line 39:             if photoInfo.Description <> String.Empty Then

Line 40:                 Dim d as String = photoInfo.Description

Source File: \GetGalleryIMG.aspx.vb    Line: 38 


Stack Trace: 


[FormatException: Input string was not in a correct format.]

   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7471479

   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119

   System.Xml.XmlConvert.ToInt32(String s) +43

   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read26_PhotoInfoTag(Boolean isNullable, Boolean checkType) +547

   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read27_PhotoInfoTags(Boolean isNullable, Boolean checkType) +463

   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read29_PhotoInfo(Boolean isNullable, Boolean checkType) +2074

   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read44_Response(Boolean isNullable, Boolean checkType) +921

   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderResponse.Read45_rsp() +76


[InvalidOperationException: There is an error in XML document (16, 69).]

   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +613

   System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) +102

   FlickrNet.Utils.Deserialize(String responseString) +81


[ResponseXmlException: Invalid response received from Flickr.]

   FlickrNet.Utils.Deserialize(String responseString) +167

   FlickrNet.Flickr.GetResponse(Hashtable parameters, TimeSpan cacheTimeout) +633

   FlickrNet.Flickr.PhotosGetInfo(String photoId, String secret) +125

   FlickrNet.Flickr.PhotosGetInfo(String photoId) +7

   RandomPicturesByScreenNameVB.Page_PreLoad(Object sender, EventArgs e) in 

   System.EventHandler.Invoke(Object sender, EventArgs e) +0

   System.Web.UI.Page.OnPreLoad(EventArgs e) +111

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +554


Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618

Jan 22, 2012 at 12:39 AM

I have the newest DLL as well. 

Jan 22, 2012 at 11:50 AM

I'm sorry to disagree with you, but it is quite obvious from the error message you provided that you don't have the latest version of the DLL. The latest version does not use the Utils.Deserialize() method anymore, infact the Utils class no longer exists.

Download the latest version here:


Jan 25, 2012 at 1:01 AM

Thanks. I downloaded from the Rolla article and had the one from codeplex downloaded in another place. Thanks.