From dd611a9ca55905b8fdab404f4432ef9c7e03ce7c Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 17 Feb 2015 21:11:51 +1300 Subject: [PATCH] -Fixed medium trust error --- .../Utilities/LateBoundReflectionDelegateFactory.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs b/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs index 2ebf601b..51876ada 100644 --- a/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs +++ b/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs @@ -48,7 +48,15 @@ namespace Newtonsoft.Json.Utilities ConstructorInfo c = method as ConstructorInfo; if (c != null) - return c.Invoke; + { + // don't convert to method group to avoid medium trust issues + // https://github.com/JamesNK/Newtonsoft.Json/issues/476 + return a => + { + object[] args = a; + return c.Invoke(args); + }; + } return a => method.Invoke(null, a); }