From fe9d519106003aa9847eefb89c7c91b390eed791 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 20 Mar 2012 19:26:40 +1300 Subject: [PATCH] -Fixed full trust permission check in non .NET 4.0 builds --- Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs index 627a9e5c..7ec74474 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs @@ -408,7 +408,15 @@ namespace Newtonsoft.Json.Serialization _fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted; #else - _fullyTrusted = true; + try + { + new SecurityPermission(PermissionState.Unrestricted).Demand(); + _fullyTrusted = true; + } + catch (Exception) + { + _fullyTrusted = false; + } #endif }