-Fixed full trust permission check in non .NET 4.0 builds

This commit is contained in:
James Newton-King
2012-03-20 19:26:40 +13:00
parent d988312c37
commit fe9d519106
@@ -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
}