-Fixed build
This commit is contained in:
@@ -64,6 +64,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
Assert.IsTrue(ms.CanRead);
|
Assert.IsTrue(ms.CanRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !(PORTABLE || NETFX_CORE)
|
||||||
[Test]
|
[Test]
|
||||||
public void WriteIConvertable()
|
public void WriteIConvertable()
|
||||||
{
|
{
|
||||||
@@ -73,6 +74,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
|
|
||||||
Assert.AreEqual("1", sw.ToString());
|
Assert.AreEqual("1", sw.ToString());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ValueFormatting()
|
public void ValueFormatting()
|
||||||
@@ -1272,6 +1274,7 @@ _____'propertyName': NaN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !(PORTABLE || NETFX_CORE)
|
||||||
public struct ConvertibleInt : IConvertible
|
public struct ConvertibleInt : IConvertible
|
||||||
{
|
{
|
||||||
private readonly int _value;
|
private readonly int _value;
|
||||||
@@ -1369,4 +1372,5 @@ _____'propertyName': NaN
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
@@ -75,4 +75,4 @@ using System.Security;
|
|||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("4.5.0.0")]
|
[assembly: AssemblyVersion("4.5.0.0")]
|
||||||
[assembly: AssemblyFileVersion("5.0.1.15931")]
|
[assembly: AssemblyFileVersion("5.0.1.16001")]
|
||||||
|
|||||||
@@ -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 class ConvertableIntTestClass
|
||||||
{
|
{
|
||||||
public ConvertibleInt Integer { get; set; }
|
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.",
|
"Error converting value 1 to type 'Newtonsoft.Json.Tests.ConvertibleInt'. Path 'Integer', line 2, position 15.",
|
||||||
() => JsonConvert.DeserializeObject<ConvertableIntTestClass>(json));
|
() => JsonConvert.DeserializeObject<ConvertableIntTestClass>(json));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void SerializeNullableWidgetStruct()
|
public void SerializeNullableWidgetStruct()
|
||||||
|
|||||||
@@ -687,11 +687,13 @@ namespace Newtonsoft.Json
|
|||||||
if (typeCode != PrimitiveTypeCode.Empty && typeCode != PrimitiveTypeCode.Object)
|
if (typeCode != PrimitiveTypeCode.Empty && typeCode != PrimitiveTypeCode.Object)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
#if !(PORTABLE || NETFX_CORE)
|
||||||
if (typeof(IConvertible).IsAssignableFrom(t)
|
if (typeof(IConvertible).IsAssignableFrom(t)
|
||||||
|| (ReflectionUtils.IsNullableType(t) && typeof(IConvertible).IsAssignableFrom(Nullable.GetUnderlyingType(t))))
|
|| (ReflectionUtils.IsNullableType(t) && typeof(IConvertible).IsAssignableFrom(Nullable.GetUnderlyingType(t))))
|
||||||
{
|
{
|
||||||
return !typeof(JToken).IsAssignableFrom(t);
|
return !typeof(JToken).IsAssignableFrom(t);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,6 @@ using System.Security;
|
|||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("4.5.0.0")]
|
[assembly: AssemblyVersion("4.5.0.0")]
|
||||||
[assembly: AssemblyFileVersion("5.0.1.15931")]
|
[assembly: AssemblyFileVersion("5.0.1.16001")]
|
||||||
|
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
|
|||||||
@@ -443,7 +443,9 @@ namespace Newtonsoft.Json.Schema
|
|||||||
case PrimitiveTypeCode.UInt32:
|
case PrimitiveTypeCode.UInt32:
|
||||||
case PrimitiveTypeCode.Int64:
|
case PrimitiveTypeCode.Int64:
|
||||||
case PrimitiveTypeCode.UInt64:
|
case PrimitiveTypeCode.UInt64:
|
||||||
|
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||||
case PrimitiveTypeCode.BigInteger:
|
case PrimitiveTypeCode.BigInteger:
|
||||||
|
#endif
|
||||||
return schemaType | JsonSchemaType.Integer;
|
return schemaType | JsonSchemaType.Integer;
|
||||||
case PrimitiveTypeCode.Single:
|
case PrimitiveTypeCode.Single:
|
||||||
case PrimitiveTypeCode.Double:
|
case PrimitiveTypeCode.Double:
|
||||||
@@ -451,7 +453,9 @@ namespace Newtonsoft.Json.Schema
|
|||||||
return schemaType | JsonSchemaType.Float;
|
return schemaType | JsonSchemaType.Float;
|
||||||
// convert to string?
|
// convert to string?
|
||||||
case PrimitiveTypeCode.DateTime:
|
case PrimitiveTypeCode.DateTime:
|
||||||
|
#if !NET20
|
||||||
case PrimitiveTypeCode.DateTimeOffset:
|
case PrimitiveTypeCode.DateTimeOffset:
|
||||||
|
#endif
|
||||||
return schemaType | JsonSchemaType.String;
|
return schemaType | JsonSchemaType.String;
|
||||||
case PrimitiveTypeCode.String:
|
case PrimitiveTypeCode.String:
|
||||||
case PrimitiveTypeCode.Uri:
|
case PrimitiveTypeCode.Uri:
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||||
using System.Globalization;
|
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
#endif
|
#endif
|
||||||
using Newtonsoft.Json.Utilities;
|
using Newtonsoft.Json.Utilities;
|
||||||
|
|||||||
@@ -25,7 +25,9 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
#endif
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -981,12 +983,16 @@ namespace Newtonsoft.Json.Utilities
|
|||||||
return 0m;
|
return 0m;
|
||||||
case PrimitiveTypeCode.DateTime:
|
case PrimitiveTypeCode.DateTime:
|
||||||
return new DateTime();
|
return new DateTime();
|
||||||
|
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||||
case PrimitiveTypeCode.BigInteger:
|
case PrimitiveTypeCode.BigInteger:
|
||||||
return new BigInteger();
|
return new BigInteger();
|
||||||
|
#endif
|
||||||
case PrimitiveTypeCode.Guid:
|
case PrimitiveTypeCode.Guid:
|
||||||
return new Guid();
|
return new Guid();
|
||||||
|
#if !NET20
|
||||||
case PrimitiveTypeCode.DateTimeOffset:
|
case PrimitiveTypeCode.DateTimeOffset:
|
||||||
return new DateTimeOffset();
|
return new DateTimeOffset();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsNullable(type))
|
if (IsNullable(type))
|
||||||
|
|||||||
Reference in New Issue
Block a user