diff --git a/uSync8.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs b/uSync8.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs index 70d677c4..7fecd9f3 100644 --- a/uSync8.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs +++ b/uSync8.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs @@ -324,8 +324,7 @@ protected void DeserializeProperties(TObject item, XElement node) var alias = propertyNode.Element("Alias").ValueOrDefault(string.Empty); if (string.IsNullOrEmpty(alias)) continue; - - var key = propertyNode.Element("Key").ValueOrDefault(Guid.Empty); + var key = propertyNode.Element("Key").ValueOrDefault(alias.GetHashCode().ToGuid()); var definitionKey = propertyNode.Element("Definition").ValueOrDefault(Guid.Empty); var propertyEditorAlias = propertyNode.Element("Type").ValueOrDefault(string.Empty); @@ -672,11 +671,10 @@ private void RemoveProperties(IContentTypeBase item, XElement properties) List removals = new List(); var nodes = properties.Elements("GenericProperty") - .Where(x => x.Element("Key").ValueOrDefault(Guid.Empty) != Guid.Empty) .Select(x => new { - Key = x.Element("Key").ValueOrDefault(Guid.Empty), + Key = (x.Element("Key").ValueOrDefault(Guid.NewGuid()) == Guid.Empty ? Guid.NewGuid() : x.Element("Key").ValueOrDefault(Guid.NewGuid())), Alias = x.Element("Alias").ValueOrDefault(string.Empty) }) .ToDictionary(k => k.Key, a => a.Alias); diff --git a/uSync8.Core/Serialization/Serializers/MemberTypeSerializer.cs b/uSync8.Core/Serialization/Serializers/MemberTypeSerializer.cs index 8d3cc393..86e9ae73 100644 --- a/uSync8.Core/Serialization/Serializers/MemberTypeSerializer.cs +++ b/uSync8.Core/Serialization/Serializers/MemberTypeSerializer.cs @@ -90,7 +90,7 @@ protected override XElement SerializeProperties(IMemberType item) var alias = property.Element("Alias").ValueOrDefault(string.Empty); if (!string.IsNullOrWhiteSpace(alias) && buildInProperties.InvariantContains(alias)) { - property.Element("Key").Value = Guid.Empty.ToString(); + property.Element("Key").Value = alias.GetHashCode().ToGuid().ToString(); } } return node;