Changeset 1682
- Timestamp:
- 04/28/09 12:40:29 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs
r1625 r1682 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using HeuristicLab.Persistence.Core.Tokens; 5 using HeuristicLab.Tracing; 6 using System.Reflection; 5 7 6 8 namespace HeuristicLab.Persistence.Core { … … 68 70 var map = new Dictionary<Type, object>(); 69 71 foreach (var typeMapping in typeCache) { 70 Type type = Type.GetType(typeMapping.TypeName, true); 72 Type type; 73 try { 74 type = Type.GetType(typeMapping.TypeName, true); 75 } catch (Exception e) { 76 Logger.Error(String.Format( 77 "Cannot load type \"{0}\", falling back to loading with partial name", typeMapping.TypeName)); 78 string[] typeNameParts = typeMapping.TypeName.Split(new[] {','}); 79 Assembly a = Assembly.LoadWithPartialName(typeNameParts[typeNameParts.Length - 1].Trim()); 80 Array.Resize(ref typeNameParts, typeNameParts.Length - 1); 81 type = a.GetType(string.Join(",", typeNameParts), true); 82 } 71 83 typeIds.Add(typeMapping.Id, type); 72 84 Type serializerType = Type.GetType(typeMapping.Serializer, true);
Note: See TracChangeset
for help on using the changeset viewer.