- Timestamp:
- 05/09/19 08:59:22 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Core/3.3/PersistenceContentManager.cs
r16907 r16933 24 24 using HeuristicLab.Persistence.Default.Xml; 25 25 using HEAL.Attic; 26 using System; 26 27 27 28 namespace HeuristicLab.Core { … … 32 33 // first try to load using the new persistence format 33 34 var ser = new ProtoBufSerializer(); 34 var o = (IStorableContent)ser.Deserialize(filename, out SerializationInfo info); 35 if (info.SerializedTypes != null) { 36 return o; 35 try { 36 return (IStorableContent)ser.Deserialize(filename, out SerializationInfo info); 37 } catch (Exception e) { 38 try { 39 // try old format if new format fails 40 return XmlParser.Deserialize<IStorableContent>(filename); 41 } catch (Exception e2) { 42 throw new AggregateException($"Cannot open file {filename}", e, e2); 43 } 37 44 } 38 // try old format if new format fails39 return XmlParser.Deserialize<IStorableContent>(filename);40 45 } 41 46
Note: See TracChangeset
for help on using the changeset viewer.