From eb2a77b7724271bb6f1b12321e86084955187793 Mon Sep 17 00:00:00 2001 From: Jack Kanarish Date: Mon, 25 Jun 2018 15:42:37 -0400 Subject: [PATCH] fix: for backwards json compatibility, if get type fails, try again after stripping assembly suffixes --- ICD.Common.Utils/Json/JsonItemWrapper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ICD.Common.Utils/Json/JsonItemWrapper.cs b/ICD.Common.Utils/Json/JsonItemWrapper.cs index 4ca434f..400068e 100644 --- a/ICD.Common.Utils/Json/JsonItemWrapper.cs +++ b/ICD.Common.Utils/Json/JsonItemWrapper.cs @@ -71,6 +71,12 @@ namespace ICD.Common.Utils.Json string itemString = (string)token.SelectToken(ITEM_TOKEN); Type type = Type.GetType(typeString); + if (type == null) + { + typeString = typeString.Replace("_SimplSharp", "").Replace("_NetStandard", ""); + type = Type.GetType(typeString); + } + return JsonConvert.DeserializeObject(itemString, type); } }