From 4b5d417659782a533121917f646d4acf2c3b1d71 Mon Sep 17 00:00:00 2001 From: JamesNK Date: Fri, 16 Jul 2010 07:53:27 +0000 Subject: [PATCH] -Fix using simple type names on Silverlight --- Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs b/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs index 682919dd..39bce071 100644 --- a/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs @@ -57,11 +57,16 @@ namespace Newtonsoft.Json.Utilities private static string GetSimpleTypeName(Type type) { +#if !SILVERLIGHT string fullyQualifiedTypeName = type.FullName + ", " + type.Assembly.GetName().Name; // for type names with no nested type names then return if (!type.IsGenericType || type.IsGenericTypeDefinition) return fullyQualifiedTypeName; +#else + // Assembly.GetName() is marked SecurityCritical + string fullyQualifiedTypeName = type.AssemblyQualifiedName; +#endif StringBuilder builder = new StringBuilder();