From 60004065fd1d00ad925bd8ea2ce45c6fe2c74e83 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 00:03:20 +1300 Subject: [PATCH 1/9] -Fixed Metro build --- .../Linq/LinqToJsonTest.cs | 1 + .../SerializationEventAttributeTests.cs | 1 + Src/Newtonsoft.Json.Tests/TestFixtureBase.cs | 5 + .../Newtonsoft.Json.Metro.csproj | 551 +++++++++--------- .../Serialization/JsonTypeReflector.cs | 4 +- 5 files changed, 285 insertions(+), 277 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs b/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs index fbf09f37..05610d1f 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs @@ -43,6 +43,7 @@ using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif +using System.IO; namespace Newtonsoft.Json.Tests.Linq { diff --git a/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs index 16b2b635..09d7f6e7 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs @@ -39,6 +39,7 @@ using TestFixture = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttrib using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; #endif using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Tests.Serialization { diff --git a/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs b/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs index c40987a5..ea7d33a1 100644 --- a/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs +++ b/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs @@ -42,6 +42,11 @@ using TestMethod = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttrib #endif using Newtonsoft.Json.Utilities; using System.Collections; +#if NET20 +using Newtonsoft.Json.Utilities.LinqBridge; +#else +using System.Linq; +#endif namespace Newtonsoft.Json.Tests { diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj index aa54ccb4..4a9d96e6 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj @@ -1,282 +1,283 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {263136A2-B89B-424E-A87A-F988CAA8D032} - Library - Properties - Newtonsoft.Json - Newtonsoft.Json - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE;NETFX_CORE - prompt - 3 - - - pdbonly - true - bin\Release\ - TRACE;NETFX_CORE - prompt - 4 - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - ARM - false - prompt - ExpressRules.ruleset - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - ARM - false - prompt - ExpressRules.ruleset - true - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - ExpressRules.ruleset - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - ExpressRules.ruleset - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - ExpressRules.ruleset - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - ExpressRules.ruleset - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 11.0 - - + + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {263136A2-B89B-424E-A87A-F988CAA8D032} + Library + Properties + Newtonsoft.Json + Newtonsoft.Json + en-US + 512 + {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + true + full + false + bin\Debug\ + DEBUG;TRACE;NETFX_CORE + prompt + 3 + + + pdbonly + true + bin\Release\ + TRACE;NETFX_CORE + prompt + 4 + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + ARM + false + prompt + ExpressRules.ruleset + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + ARM + false + prompt + ExpressRules.ruleset + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x64 + false + prompt + ExpressRules.ruleset + true + + + bin\x64\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x64 + false + prompt + ExpressRules.ruleset + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x86 + false + prompt + ExpressRules.ruleset + true + + + bin\x86\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x86 + false + prompt + ExpressRules.ruleset + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11.0 + + + --> \ No newline at end of file diff --git a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs index 180ce080..627a9e5c 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs @@ -28,7 +28,6 @@ using System.ComponentModel; using System.Globalization; using System.Reflection; #if !NETFX_CORE -using System.Runtime.Serialization; using System.Security.Permissions; #endif using Newtonsoft.Json.Utilities; @@ -40,6 +39,7 @@ using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif +using System.Runtime.Serialization; namespace Newtonsoft.Json.Serialization { @@ -403,7 +403,7 @@ namespace Newtonsoft.Json.Serialization { if (_fullyTrusted == null) { -#if !(NET20 || NET35 || SILVERLIGHT) +#if !(NET20 || NET35 || SILVERLIGHT || NETFX_CORE) AppDomain appDomain = AppDomain.CurrentDomain; _fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted; From 2b353d389c0b17f432faab9b5ba35e44b8ad4d94 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 19:00:51 +1300 Subject: [PATCH 2/9] -Updated version to 4.5.1 -Changed build script to include Metro build -Changed build script to set assembly version to major version only -Documentation --- Build/Newtonsoft.Json.nuspec | 2 +- Build/build.ps1 | 12 +- Doc/versions.txt | 5 +- .../Newtonsoft.Json.Tests.Metro.csproj | 626 +++++++++--------- .../Properties/AssemblyInfo.cs | 4 +- .../Newtonsoft.Json.Metro.csproj | 5 +- .../Properties/AssemblyInfo.cs | 4 +- 7 files changed, 332 insertions(+), 326 deletions(-) diff --git a/Build/Newtonsoft.Json.nuspec b/Build/Newtonsoft.Json.nuspec index 53e2f345..5b1a08cf 100644 --- a/Build/Newtonsoft.Json.nuspec +++ b/Build/Newtonsoft.Json.nuspec @@ -2,7 +2,7 @@ Newtonsoft.Json - 4.0.8 + 4.5.1 Json.NET Json.NET is a popular high-performance JSON framework for .NET James Newton-King diff --git a/Build/build.ps1 b/Build/build.ps1 index bb39c000..a5ef4e89 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -1,7 +1,8 @@ properties { - $zipFileName = "Json40r8.zip" - $majorVersion = "4.0.8" - $version = GetVersion $majorVersion + $zipFileName = "Json45r1.zip" + $majorVersion = "4.5" + $majorWithReleaseVersion = "4.5.1" + $version = GetVersion $majorWithReleaseVersion $signAssemblies = $false $signKeyPath = "D:\Development\Releases\newtonsoft.snk" $buildDocumentation = $false @@ -16,6 +17,7 @@ $workingDir = "$baseDir\Working" $builds = @( @{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net40"; NuGetDir = "net40"; Framework="net-4.0"; Sign=$true}, + @{Name = "Newtonsoft.Json.Metro"; TestsName = $null; Constants="NETFX_CORE"; FinalDir="Metro"; NuGetDir = "winrt45"; Framework="net-4.5"; Sign=$true}, # unsigned SL/WP @{Name = "Newtonsoft.Json.WindowsPhone"; TestsName = $null; Constants="SILVERLIGHT;WINDOWS_PHONE"; FinalDir="WindowsPhone"; NuGetDir = "sl3-wp,sl4-windowsphone71"; Framework="net-4.0"; Sign=$false}, @@ -51,7 +53,7 @@ task Clean { task Build -depends Clean { Write-Host -ForegroundColor Green "Updating assembly version" Write-Host - Update-AssemblyInfoFiles $sourceDir ($majorVersion + '.0') $version + Update-AssemblyInfoFiles $sourceDir ($majorVersion + '.0.0') $version foreach ($build in $builds) { @@ -117,7 +119,7 @@ task Package -depends Build { Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\ Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\ - robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj /XF *.suo *.user + robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults /XF *.suo *.user robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XD .svn robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP /XD .svn robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP /XD .svn diff --git a/Doc/versions.txt b/Doc/versions.txt index 4ed5b174..82e7cb89 100644 --- a/Doc/versions.txt +++ b/Doc/versions.txt @@ -3,7 +3,7 @@ Versions: Json.NET comes in different versions for the various .NET frameworks. -Net40: - .NET latest (4.0) + .NET latest (4.0 & 4.5) -Net35: .NET 3.5 SP1, Mono @@ -17,6 +17,9 @@ Json.NET comes in different versions for the various .NET frameworks. -WindowsPhone: Windows Phone 7 & 7.1 +-Metro + Windows 8 Metro, WinRT 4.5 + Notes: diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Metro.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Metro.csproj index 31b40504..6735ed50 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Metro.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Metro.csproj @@ -1,320 +1,320 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B} - Library - Properties - Newtonsoft.Json.Tests - Newtonsoft.Json.Tests - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Newtonsoft.Json.Tests.Metro_TemporaryKey.pfx - E58487D6BF8E40BC44C9BE962D19FB3EFBEB81BD - - - true - full - false - bin\Debug\ - DEBUG;TRACE;NETFX_CORE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE;NETFX_CORE - prompt - 4 - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - ARM - false - prompt - ExpressRules.ruleset - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - ARM - false - prompt - ExpressRules.ruleset - true - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - ExpressRules.ruleset - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - ExpressRules.ruleset - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - ExpressRules.ruleset - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - ExpressRules.ruleset - true - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - {263136a2-b89b-424e-a87a-f988caa8d032} - Newtonsoft.Json.Metro - - - - - - - 11.0 - - + + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B} + Library + Properties + Newtonsoft.Json.Tests + Newtonsoft.Json.Tests + en-US + 512 + {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Newtonsoft.Json.Tests.Metro_TemporaryKey.pfx + E58487D6BF8E40BC44C9BE962D19FB3EFBEB81BD + + + true + full + false + bin\Debug\Metro\ + DEBUG;TRACE;NETFX_CORE + prompt + 4 + + + pdbonly + true + bin\Release\Metro\ + TRACE;NETFX_CORE + prompt + 4 + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + ARM + false + prompt + ExpressRules.ruleset + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + ARM + false + prompt + ExpressRules.ruleset + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x64 + false + prompt + ExpressRules.ruleset + true + + + bin\x64\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x64 + false + prompt + ExpressRules.ruleset + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x86 + false + prompt + ExpressRules.ruleset + true + + + bin\x86\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x86 + false + prompt + ExpressRules.ruleset + true + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + {263136a2-b89b-424e-a87a-f988caa8d032} + Newtonsoft.Json.Metro + + + + + + + 11.0 + + + --> \ 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 e55896be..db242d26 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -70,7 +70,7 @@ 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.0.8.0")] +[assembly: AssemblyVersion("4.5.0.0")] #if !PocketPC -[assembly: AssemblyFileVersion("4.0.8.14718")] +[assembly: AssemblyFileVersion("4.5.1.14719")] #endif diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj index 4a9d96e6..cf485b1e 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj @@ -19,7 +19,7 @@ true full false - bin\Debug\ + bin\Debug\Metro\ DEBUG;TRACE;NETFX_CORE prompt 3 @@ -27,10 +27,11 @@ pdbonly true - bin\Release\ + bin\Release\Metro\ TRACE;NETFX_CORE prompt 4 + bin\Release\Metro\Newtonsoft.Json.xml true diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 47b1f423..a399274c 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -83,9 +83,9 @@ 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.0.8.0")] +[assembly: AssemblyVersion("4.5.0.0")] #if !PocketPC -[assembly: AssemblyFileVersion("4.0.8.14718")] +[assembly: AssemblyFileVersion("4.5.1.14719")] #endif [assembly: CLSCompliant(true)] From e05499bfb28a06a5007f82deda894605c4265d6e Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 20:03:15 +1300 Subject: [PATCH 3/9] -Fixed Metro build --- Src/Newtonsoft.Json.Metro.sln | 128 +++++++++--------- .../Newtonsoft.Json.Metro.csproj | 2 +- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Src/Newtonsoft.Json.Metro.sln b/Src/Newtonsoft.Json.Metro.sln index 687fce8f..11b6953f 100644 --- a/Src/Newtonsoft.Json.Metro.sln +++ b/Src/Newtonsoft.Json.Metro.sln @@ -1,64 +1,64 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 11 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Metro", "Newtonsoft.Json\Newtonsoft.Json.Metro.csproj", "{263136A2-B89B-424E-A87A-F988CAA8D032}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Tests.Metro", "Newtonsoft.Json.Tests\Newtonsoft.Json.Tests.Metro.csproj", "{8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|ARM.ActiveCfg = Debug|ARM - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|ARM.Build.0 = Debug|ARM - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|Any CPU.Build.0 = Debug|Any CPU - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x64.ActiveCfg = Debug|x64 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x64.Build.0 = Debug|x64 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x86.ActiveCfg = Debug|x86 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x86.Build.0 = Debug|x86 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|ARM.ActiveCfg = Release|ARM - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|ARM.Build.0 = Release|ARM - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|Any CPU.ActiveCfg = Release|Any CPU - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|Any CPU.Build.0 = Release|Any CPU - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x64.ActiveCfg = Release|x64 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x64.Build.0 = Release|x64 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x86.ActiveCfg = Release|x86 - {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x86.Build.0 = Release|x86 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|ARM.ActiveCfg = Debug|ARM - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|ARM.Build.0 = Debug|ARM - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|ARM.Deploy.0 = Debug|ARM - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x64.ActiveCfg = Debug|x64 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x64.Build.0 = Debug|x64 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x64.Deploy.0 = Debug|x64 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x86.ActiveCfg = Debug|x86 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x86.Build.0 = Debug|x86 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x86.Deploy.0 = Debug|x86 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|ARM.ActiveCfg = Release|ARM - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|ARM.Build.0 = Release|ARM - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|ARM.Deploy.0 = Release|ARM - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|Any CPU.Build.0 = Release|Any CPU - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|Any CPU.Deploy.0 = Release|Any CPU - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x64.ActiveCfg = Release|x64 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x64.Build.0 = Release|x64 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x64.Deploy.0 = Release|x64 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x86.ActiveCfg = Release|x86 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x86.Build.0 = Release|x86 - {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 11 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Metro", "Newtonsoft.Json\Newtonsoft.Json.Metro.csproj", "{263136A2-B89B-424E-A87A-F988CAA8D032}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Tests.Metro", "Newtonsoft.Json.Tests\Newtonsoft.Json.Tests.Metro.csproj", "{8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|ARM.ActiveCfg = Debug|ARM + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|ARM.Build.0 = Debug|ARM + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|Any CPU.Build.0 = Debug|Any CPU + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x64.ActiveCfg = Debug|x64 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x64.Build.0 = Debug|x64 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x86.ActiveCfg = Debug|x86 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Debug|x86.Build.0 = Debug|x86 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|ARM.ActiveCfg = Release|ARM + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|ARM.Build.0 = Release|ARM + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|Any CPU.ActiveCfg = Release|Any CPU + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|Any CPU.Build.0 = Release|Any CPU + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x64.ActiveCfg = Release|x64 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x64.Build.0 = Release|x64 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x86.ActiveCfg = Release|x86 + {263136A2-B89B-424E-A87A-F988CAA8D032}.Release|x86.Build.0 = Release|x86 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|ARM.ActiveCfg = Debug|ARM + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|ARM.Build.0 = Debug|ARM + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|ARM.Deploy.0 = Debug|ARM + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x64.ActiveCfg = Debug|x64 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x64.Build.0 = Debug|x64 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x64.Deploy.0 = Debug|x64 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x86.ActiveCfg = Debug|x86 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x86.Build.0 = Debug|x86 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Debug|x86.Deploy.0 = Debug|x86 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|ARM.ActiveCfg = Release|ARM + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|ARM.Build.0 = Release|ARM + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|ARM.Deploy.0 = Release|ARM + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|Any CPU.Build.0 = Release|Any CPU + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|Any CPU.Deploy.0 = Release|Any CPU + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x64.ActiveCfg = Release|x64 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x64.Build.0 = Release|x64 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x64.Deploy.0 = Release|x64 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x86.ActiveCfg = Release|x86 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x86.Build.0 = Release|x86 + {8D9C2E69-9FD7-4A7A-866C-739C9207CD0B}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj index cf485b1e..6c5973bf 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj @@ -170,6 +170,7 @@ + @@ -213,7 +214,6 @@ - From 10aee582bc93901aeef160b0bdd82be153f5f188 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 21:17:12 +1300 Subject: [PATCH 4/9] -Various Metro fixes --- Build/build.ps1 | 2 +- Src/Newtonsoft.Json/Properties/AssemblyInfo.cs | 3 +++ Src/Newtonsoft.Json/SerializationBinder.cs | 8 +++++++- Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index a5ef4e89..049231ee 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -119,7 +119,7 @@ task Package -depends Build { Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\ Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\ - robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults /XF *.suo *.user + robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackage /XF *.suo *.user *.pri robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XD .svn robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP /XD .svn robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP /XD .svn diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index a399274c..ba840dea 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -38,6 +38,9 @@ using System.Security; [assembly: AssemblyTitle("Json.NET Silverlight")] #elif PocketPC [assembly: AssemblyTitle("Json.NET Compact")] +#elif NETFX_CORE +[assembly: AssemblyTitle("Json.NET Metro")] +[assembly: AllowPartiallyTrustedCallers] #elif NET20 [assembly: AssemblyTitle("Json.NET .NET 2.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/Src/Newtonsoft.Json/SerializationBinder.cs b/Src/Newtonsoft.Json/SerializationBinder.cs index 760068c7..2f79df4d 100644 --- a/Src/Newtonsoft.Json/SerializationBinder.cs +++ b/Src/Newtonsoft.Json/SerializationBinder.cs @@ -14,9 +14,15 @@ namespace Newtonsoft.Json /// /// Specifies the name of the serialized object. /// Specifies the name of the serialized object - /// + /// The type of the object the formatter creates a new instance of. public abstract Type BindToType(string assemblyName, string typeName); + /// + /// When overridden in a derived class, controls the binding of a serialized object to a type. + /// + /// The type of the object the formatter creates a new instance of. + /// Specifies the name of the serialized object. + /// Specifies the name of the serialized object. public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName) { assemblyName = null; diff --git a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs index 93acf1b0..f3fea9cf 100644 --- a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs @@ -18,14 +18,14 @@ namespace Newtonsoft.Json.Utilities new IDictionaryEnumerator GetEnumerator(); } - public interface IDictionaryEnumerator : IEnumerator + internal interface IDictionaryEnumerator : IEnumerator { DictionaryEntry Entry { get; } object Key { get; } object Value { get; } } - public struct DictionaryEntry + internal struct DictionaryEntry { private readonly object _key; private readonly object _value; From 167f186610c3694029df909a14c6e0a3ab446e85 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 22:03:45 +1300 Subject: [PATCH 5/9] -Fixed Metro build targeting ARM for some reason --- Build/build.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 049231ee..963492ad 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -64,7 +64,7 @@ task Build -depends Clean { Write-Host -ForegroundColor Green "Building " $name Write-Host -ForegroundColor Green "Signed " $sign Write-Host - exec { msbuild "/t:Clean;Rebuild" /p:Configuration=Release /p:OutputPath=bin\Release\$finalDir\ /p:AssemblyOriginatorKeyFile=$signKeyPath "/p:SignAssembly=$sign" (GetConstants $build.Constants $sign) ".\Src\$name.sln" } "Error building $name" + exec { msbuild "/t:Clean;Rebuild" /p:Configuration=Release "/p:Platform=Any CPU" /p:OutputPath=bin\Release\$finalDir\ /p:AssemblyOriginatorKeyFile=$signKeyPath "/p:SignAssembly=$sign" (GetConstants $build.Constants $sign) ".\Src\$name.sln" } "Error building $name" } } @@ -93,7 +93,7 @@ task Package -depends Build { foreach ($frameworkDir in $frameworkDirs) { - robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\NuGet\lib\$frameworkDir /NP /XO + robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\NuGet\lib\$frameworkDir /NP /XO /XF *.pri } } } @@ -119,7 +119,7 @@ task Package -depends Build { Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\ Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\ - robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackage /XF *.suo *.user *.pri + robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackage /XF *.suo *.user robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XD .svn robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP /XD .svn robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP /XD .svn From 1bd218523052921327f3019ff350aca6e2ef49b6 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 22:10:57 +1300 Subject: [PATCH 6/9] -More build fixes --- Build/build.ps1 | 4 ++-- Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 963492ad..fc673f04 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -75,7 +75,7 @@ task Package -depends Build { $name = $build.TestsName $finalDir = $build.FinalDir - robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\Package\Bin\$finalDir /NP /XO + robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\Package\Bin\$finalDir /NP /XO /XF *.pri } if ($buildNuGet) @@ -119,7 +119,7 @@ task Package -depends Build { Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\ Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\ - robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackage /XF *.suo *.user + robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackages /XF *.suo *.user robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XD .svn robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP /XD .svn robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP /XD .svn diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj index 6c5973bf..ef005766 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Metro.csproj @@ -274,11 +274,11 @@ 11.0 - \ No newline at end of file From d988312c37692e7cdd626b1a38ce7607e18423cb Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 20 Mar 2012 01:08:30 +1300 Subject: [PATCH 7/9] -Documentation --- Doc/DatesInJSON.html | 11 +++++-- Doc/SerializationSettings.html | 38 ++++++++++++++++++++++- Src/Newtonsoft.Json/DateFormatHandling.cs | 2 +- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Doc/DatesInJSON.html b/Doc/DatesInJSON.html index fab328c9..64e8c473 100644 --- a/Doc/DatesInJSON.html +++ b/Doc/DatesInJSON.html @@ -17,7 +17,12 @@

DateTimes in JSON are hard.

The problem comes from the JSON spec itself, there is no literal syntax for dates in JSON. The spec has objects, arrays, strings, integers and floats, but it defines no standard for what a date looks like.

-

The default format used by Json.NET for dates is the same one used by Microsoft: "\/Date(1198908717056)\/". You can read more about it here.

+

The default format used by Json.NET + is the ISO 8601 standard: 2012-03-19T07:22Z. You can read more about it here.

+

Prior to Json.NET 4.5 dates were written using the Microsoft format: + "\/Date(1198908717056)\/". If you want to use this format, or you want to + maintain compatibility with Microsoft JSON serializers or older versions of + Json.NET then change the DateFormatHandling setting to MicrosoftDateFormat.

DateTime JsonConverters

With no standard for dates in JSON, the number of possible different formats when interoping with other systems is endless. Fortunately Json.NET has a solution to deal with reading and writing custom dates: JsonConverters. A JsonConverter is used to override how a type is serialized.

@@ -72,7 +77,9 @@

Technically this is invalid JSON according to the spec but all browsers, and some JSON frameworks including Json.NET, support it.

IsoDateTimeConverter

-

IsoDateTimeConverter seralizes a DateTime to an ISO 8601 formatted string.

+

IsoDateTimeConverter seralizes a DateTime to an ISO 8601 formatted string. + Note that since Json.NET 4.5 dates are written using the ISO 8601 format by + default and using this converter is unnecessary.

diff --git a/Doc/SerializationSettings.html b/Doc/SerializationSettings.html index d11a80f0..80927908 100644 --- a/Doc/SerializationSettings.html +++ b/Doc/SerializationSettings.html @@ -19,7 +19,43 @@ JSON. These can also be used with the methods on JsonConvert via the JsonSerializerSettings overloads.

-

MissingMemberHandling

+

DateFormatHandling

+

DateFormatHandling controls how dates are serialized.

+ + + + + + + + + + + + + + + +
+ Member + + Description +
+ IsoDateFormat + +
+ By default Json.NET writes dates in the ISO 8601 format, e.g. "2012-03-21T05:40Z". +
+
+
+ MicrosoftDateFormat + +
+ Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". +
+
+
+

MissingMemberHandling

MissingMemberHandling controls how missing members, e.g. JSON contains a property that isn't a member on the object, are handled during deserialization.

diff --git a/Src/Newtonsoft.Json/DateFormatHandling.cs b/Src/Newtonsoft.Json/DateFormatHandling.cs index 47efaf4b..e2fed587 100644 --- a/Src/Newtonsoft.Json/DateFormatHandling.cs +++ b/Src/Newtonsoft.Json/DateFormatHandling.cs @@ -6,7 +6,7 @@ namespace Newtonsoft.Json public enum DateFormatHandling { /// - /// Dates are written in the ISO 8061 format, e.g. "2012-03-21T05:40Z". + /// Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". /// IsoDateFormat, /// From fe9d519106003aa9847eefb89c7c91b390eed791 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 20 Mar 2012 19:26:40 +1300 Subject: [PATCH 8/9] -Fixed full trust permission check in non .NET 4.0 builds --- Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs index 627a9e5c..7ec74474 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs @@ -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 } From 471c3e0803a9f40a0acc8aeceb31de6ff93a52c4 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 20 Mar 2012 19:33:07 +1300 Subject: [PATCH 9/9] -Fixed Metro build --- Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs index 7ec74474..f546978e 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs @@ -403,7 +403,9 @@ namespace Newtonsoft.Json.Serialization { if (_fullyTrusted == null) { -#if !(NET20 || NET35 || SILVERLIGHT || NETFX_CORE) +#if (NETFX_CORE || SILVERLIGHT) + _fullyTrusted = false; +#elif !(NET20 || NET35) AppDomain appDomain = AppDomain.CurrentDomain; _fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted;