-Incremented version to 6.0.1
-Changed .NET 4 Portable NuGet target to portable-net40+sl5+wp80+win8+monotouch+monoandroid -Fixed Uri serialization roundtrip by using Uri.OriginalString -Added Decimal and DateTimeOffset constructors to JValue -Changed DefaultMemberSearchFlags on DefaultContractResolver to obsolete
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Newtonsoft.Json</id>
|
||||
<version>5.0.8</version>
|
||||
<version>6.0.1-beta1</version>
|
||||
<title>Json.NET</title>
|
||||
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
|
||||
<authors>James Newton-King</authors>
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
properties {
|
||||
$zipFileName = "Json50r8.zip"
|
||||
$zipFileName = "Json60r1.zip"
|
||||
$majorVersion = "4.5"
|
||||
$majorWithReleaseVersion = "5.0.8"
|
||||
$majorWithReleaseVersion = "6.0.1"
|
||||
$version = GetVersion $majorWithReleaseVersion
|
||||
$signAssemblies = $false
|
||||
$signKeyPath = "C:\Development\Releases\newtonsoft.snk"
|
||||
@@ -19,7 +19,7 @@
|
||||
$builds = @(
|
||||
@{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net45"; NuGetDir = "net45"; Framework="net-4.0"; Sign=$true},
|
||||
@{Name = "Newtonsoft.Json.Portable"; TestsName = "Newtonsoft.Json.Tests.Portable"; Constants="PORTABLE"; FinalDir="Portable"; NuGetDir = "portable-net45+wp80+win8"; Framework="net-4.0"; Sign=$true},
|
||||
@{Name = "Newtonsoft.Json.Portable40"; TestsName = "Newtonsoft.Json.Tests.Portable40"; Constants="PORTABLE40"; FinalDir="Portable40"; NuGetDir = "portable-net40+sl4+wp7+win8"; Framework="net-4.0"; Sign=$true},
|
||||
@{Name = "Newtonsoft.Json.Portable40"; TestsName = "Newtonsoft.Json.Tests.Portable40"; Constants="PORTABLE40"; FinalDir="Portable40"; NuGetDir = "portable-net40+sl5+wp80+win8+monotouch+monoandroid"; Framework="net-4.0"; Sign=$true},
|
||||
@{Name = "Newtonsoft.Json.WinRT"; TestsName = $null; Constants="NETFX_CORE"; FinalDir="WinRT"; NuGetDir = "netcore45"; Framework="net-4.5"; Sign=$true},
|
||||
@{Name = "Newtonsoft.Json.Net40"; TestsName = "Newtonsoft.Json.Tests.Net40"; Constants="NET40"; FinalDir="Net40"; NuGetDir = "net40"; Framework="net-4.0"; Sign=$true},
|
||||
@{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "net35"; Framework="net-2.0"; Sign=$true},
|
||||
|
||||
@@ -102,7 +102,6 @@
|
||||
<Reference Include="System.Web.Extensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
|
||||
@@ -75,4 +75,4 @@ using System.Security;
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("4.5.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.0.8.16826")]
|
||||
[assembly: AssemblyFileVersion("6.0.1.16909")]
|
||||
|
||||
@@ -9937,6 +9937,20 @@ Parameter name: value",
|
||||
}", s);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void RoundtripUriOriginalString()
|
||||
{
|
||||
string originalUri = "https://test.com?m=a%2bb";
|
||||
|
||||
Uri uriWithPlus = new Uri(originalUri);
|
||||
|
||||
string jsonWithPlus = JsonConvert.SerializeObject(uriWithPlus);
|
||||
|
||||
Uri uriWithPlus2 = JsonConvert.DeserializeObject<Uri>(jsonWithPlus);
|
||||
|
||||
Assert.AreEqual(originalUri, uriWithPlus2.OriginalString);
|
||||
}
|
||||
}
|
||||
|
||||
public class PersonReference
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace Newtonsoft.Json
|
||||
|
||||
internal static string ToString(Uri value, char quoteChar)
|
||||
{
|
||||
return ToString(value.ToString(), quoteChar);
|
||||
return ToString(value.OriginalString, quoteChar);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -73,6 +73,15 @@ namespace Newtonsoft.Json.Linq
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JValue"/> class with the given value.
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
public JValue(decimal value)
|
||||
: this(value, JTokenType.Float)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JValue"/> class with the given value.
|
||||
/// </summary>
|
||||
@@ -119,6 +128,17 @@ namespace Newtonsoft.Json.Linq
|
||||
{
|
||||
}
|
||||
|
||||
#if !NET20
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JValue"/> class with the given value.
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
public JValue(DateTimeOffset value)
|
||||
: this(value, JTokenType.Date)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JValue"/> class with the given value.
|
||||
/// </summary>
|
||||
|
||||
@@ -91,5 +91,5 @@ using System.Security;
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("4.5.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.0.8.16826")]
|
||||
[assembly: AssemblyFileVersion("6.0.1.16909")]
|
||||
[assembly: CLSCompliant(true)]
|
||||
|
||||
@@ -143,9 +143,10 @@ namespace Newtonsoft.Json.Serialization
|
||||
/// Gets or sets the default members search flags.
|
||||
/// </summary>
|
||||
/// <value>The default members search flags.</value>
|
||||
[ObsoleteAttribute("DefaultMembersSearchFlags is obsolete. Inherit from DefaultContractResolver and override the GetSerializableMembers method instead.")]
|
||||
public BindingFlags DefaultMembersSearchFlags { get; set; }
|
||||
#else
|
||||
private BindingFlags DefaultMembersSearchFlags = BindingFlags.Instance | BindingFlags.Public;
|
||||
private BindingFlags DefaultMembersSearchFlags = BindingFlags.Instance | BindingFlags.Public;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
@@ -194,7 +195,9 @@ namespace Newtonsoft.Json.Serialization
|
||||
public DefaultContractResolver(bool shareCache)
|
||||
{
|
||||
#if !NETFX_CORE
|
||||
#pragma warning disable 618
|
||||
DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance;
|
||||
#pragma warning restore 618
|
||||
#endif
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true;
|
||||
@@ -280,8 +283,10 @@ namespace Newtonsoft.Json.Serialization
|
||||
DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(objectType);
|
||||
#endif
|
||||
|
||||
#pragma warning disable 618
|
||||
List<MemberInfo> defaultMembers = ReflectionUtils.GetFieldsAndProperties(objectType, DefaultMembersSearchFlags)
|
||||
.Where(m => !ReflectionUtils.IsIndexedProperty(m)).ToList();
|
||||
#pragma warning restore 618
|
||||
|
||||
foreach (MemberInfo member in allMembers)
|
||||
{
|
||||
@@ -1248,8 +1253,10 @@ namespace Newtonsoft.Json.Serialization
|
||||
property.ItemTypeNameHandling = (propertyAttribute != null) ? propertyAttribute._itemTypeNameHandling : null;
|
||||
|
||||
allowNonPublicAccess = false;
|
||||
#pragma warning disable 618
|
||||
if ((DefaultMembersSearchFlags & BindingFlags.NonPublic) == BindingFlags.NonPublic)
|
||||
allowNonPublicAccess = true;
|
||||
#pragma warning restore 618
|
||||
if (propertyAttribute != null)
|
||||
allowNonPublicAccess = true;
|
||||
if (memberSerialization == MemberSerialization.Fields)
|
||||
|
||||
Reference in New Issue
Block a user