diff options
author | JamesNK <james@newtonking.com> | 2011-05-21 08:05:48 +0400 |
---|---|---|
committer | JamesNK <james@newtonking.com> | 2011-05-21 08:05:48 +0400 |
commit | 76706c6cd256b27d8298744a0a2ff35a59ac4484 (patch) | |
tree | 871faae1a80cb7d618de4c9338470b0ead653f87 /Src/Newtonsoft.Json | |
parent | 6b2238c39c8365c3aafc320775952b42cc1ed302 (diff) |
-Fixed BsonWriter failing silently when writing values outside of an Object or Array
-Fixed serializer attempting to use dynamic code generation in partial trust
Diffstat (limited to 'Src/Newtonsoft.Json')
-rw-r--r-- | Src/Newtonsoft.Json/Bson/BsonWriter.cs | 3 | ||||
-rw-r--r-- | Src/Newtonsoft.Json/Properties/AssemblyInfo.cs | 2 | ||||
-rw-r--r-- | Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/Src/Newtonsoft.Json/Bson/BsonWriter.cs b/Src/Newtonsoft.Json/Bson/BsonWriter.cs index 7975070..4f7c4cb 100644 --- a/Src/Newtonsoft.Json/Bson/BsonWriter.cs +++ b/Src/Newtonsoft.Json/Bson/BsonWriter.cs @@ -199,6 +199,9 @@ namespace Newtonsoft.Json.Bson }
else
{
+ if (token.Type != BsonType.Object && token.Type != BsonType.Array)
+ throw new JsonWriterException("Error writing {0} value. BSON must start with an Object or Array.".FormatWith(CultureInfo.InvariantCulture, token.Type));
+
_parent = token;
_root = token;
}
diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index c78177a..b1c274d 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -110,7 +110,7 @@ using System.Security; // by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.2.0")]
#if !PocketPC
-[assembly: AssemblyFileVersion("4.0.2.13707")]
+[assembly: AssemblyFileVersion("4.0.2.13721")]
#endif
[assembly: CLSCompliant(true)]
diff --git a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs index b53a9f1..e1f0857 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs @@ -271,6 +271,7 @@ namespace Newtonsoft.Json.Serialization new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand();
new ReflectionPermission(ReflectionPermissionFlag.RestrictedMemberAccess).Demand();
new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
+ new SecurityPermission(PermissionState.Unrestricted).Demand();
_dynamicCodeGeneration = true;
}
catch (Exception)
|