Это код:
var serializer = new DataContractSerializer(typeof(QuoteAndOfferCollection));
try
{
using (var file = File.OpenRead(filename))
{
offers = (QuoteAndOfferCollection)serializer.ReadObject(file);
}
}
catch (SerializationException sex)
{
File.AppendAllText(log, "Deserialization failed - " + sex);
return;
}
И вот ошибка, которую я получаю:
xmlDeserialization failed - System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type Services.Dto2.QuoteAndOfferCollection. The value '' cannot be parsed as the type 'Int32'. ---> System.Xml.XmlException: The value '' cannot be parsed as the type 'Int32'. ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Xml.XmlConvert.ToInt32(String s)
at System.Xml.XmlConverter.ToInt32(String value)
Я не могу отследить часть '' .