diff --git a/Src/Newtonsoft.Json.Tests/JsonTextWriterTest.cs b/Src/Newtonsoft.Json.Tests/JsonTextWriterTest.cs index 18aa1862..b0cf0f28 100644 --- a/Src/Newtonsoft.Json.Tests/JsonTextWriterTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonTextWriterTest.cs @@ -64,6 +64,7 @@ namespace Newtonsoft.Json.Tests Assert.IsTrue(ms.CanRead); } +#if !(PORTABLE || NETFX_CORE) [Test] public void WriteIConvertable() { @@ -73,6 +74,7 @@ namespace Newtonsoft.Json.Tests Assert.AreEqual("1", sw.ToString()); } +#endif [Test] public void ValueFormatting() @@ -1272,6 +1274,7 @@ _____'propertyName': NaN } } +#if !(PORTABLE || NETFX_CORE) public struct ConvertibleInt : IConvertible { private readonly int _value; @@ -1369,4 +1372,5 @@ _____'propertyName': NaN throw new NotImplementedException(); } } +#endif } \ No newline at end of file diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index 55289ad3..d07ad717 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -75,4 +75,4 @@ using System.Security; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] -[assembly: AssemblyFileVersion("5.0.1.15931")] +[assembly: AssemblyFileVersion("5.0.1.16001")] diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index d96ac16e..e224a18d 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -5762,6 +5762,7 @@ To fix this error either change the environment to be fully trusted, change the }); } +#if !(PORTABLE || NETFX_CORE) public class ConvertableIntTestClass { public ConvertibleInt Integer { get; set; } @@ -5801,6 +5802,7 @@ To fix this error either change the environment to be fully trusted, change the "Error converting value 1 to type 'Newtonsoft.Json.Tests.ConvertibleInt'. Path 'Integer', line 2, position 15.", () => JsonConvert.DeserializeObject(json)); } +#endif [Test] public void SerializeNullableWidgetStruct() diff --git a/Src/Newtonsoft.Json/JsonConvert.cs b/Src/Newtonsoft.Json/JsonConvert.cs index 852b1c11..035d68dd 100644 --- a/Src/Newtonsoft.Json/JsonConvert.cs +++ b/Src/Newtonsoft.Json/JsonConvert.cs @@ -687,11 +687,13 @@ namespace Newtonsoft.Json if (typeCode != PrimitiveTypeCode.Empty && typeCode != PrimitiveTypeCode.Object) return true; +#if !(PORTABLE || NETFX_CORE) if (typeof(IConvertible).IsAssignableFrom(t) || (ReflectionUtils.IsNullableType(t) && typeof(IConvertible).IsAssignableFrom(Nullable.GetUnderlyingType(t)))) { return !typeof(JToken).IsAssignableFrom(t); } +#endif return false; } diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 52274148..6358d699 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -90,6 +90,6 @@ using System.Security; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] -[assembly: AssemblyFileVersion("5.0.1.15931")] +[assembly: AssemblyFileVersion("5.0.1.16001")] [assembly: CLSCompliant(true)] diff --git a/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs b/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs index 7c9da1b7..6f552ce7 100644 --- a/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs +++ b/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs @@ -443,7 +443,9 @@ namespace Newtonsoft.Json.Schema case PrimitiveTypeCode.UInt32: case PrimitiveTypeCode.Int64: case PrimitiveTypeCode.UInt64: +#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) case PrimitiveTypeCode.BigInteger: +#endif return schemaType | JsonSchemaType.Integer; case PrimitiveTypeCode.Single: case PrimitiveTypeCode.Double: @@ -451,7 +453,9 @@ namespace Newtonsoft.Json.Schema return schemaType | JsonSchemaType.Float; // convert to string? case PrimitiveTypeCode.DateTime: +#if !NET20 case PrimitiveTypeCode.DateTimeOffset: +#endif return schemaType | JsonSchemaType.String; case PrimitiveTypeCode.String: case PrimitiveTypeCode.Uri: diff --git a/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs b/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs index 6fccf30e..07222762 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs @@ -25,7 +25,6 @@ using System; #if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) -using System.Globalization; using System.Numerics; #endif using Newtonsoft.Json.Utilities; diff --git a/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs b/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs index 8893a3de..89bc330c 100644 --- a/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs @@ -25,7 +25,9 @@ using System; using System.Collections.Generic; +#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) using System.Numerics; +#endif using System.Reflection; using System.Collections; using System.Globalization; @@ -981,12 +983,16 @@ namespace Newtonsoft.Json.Utilities return 0m; case PrimitiveTypeCode.DateTime: return new DateTime(); +#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) case PrimitiveTypeCode.BigInteger: return new BigInteger(); +#endif case PrimitiveTypeCode.Guid: return new Guid(); +#if !NET20 case PrimitiveTypeCode.DateTimeOffset: return new DateTimeOffset(); +#endif } if (IsNullable(type))