From 60004065fd1d00ad925bd8ea2ce45c6fe2c74e83 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 00:03:20 +1300 Subject: [PATCH] -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;