diff --git a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs index afa1b790..85888b0f 100644 --- a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs @@ -3249,6 +3249,7 @@ null//comment "Unexpected character encountered while parsing value: !. Path 'frameworks.dnxcore50.dependencies.['System.Xml.ReaderWriter'].source', line 6, position 21."); } +#if !DNXCORE50 [Test] [Ignore("Fix this next major version")] public void LinePositionOnNewLine() @@ -3297,6 +3298,7 @@ null//comment Assert.IsFalse(r.Read()); } +#endif } public class ToggleReaderError : TextReader diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj index 7e4c5052..95d3aaf9 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj @@ -335,6 +335,7 @@ + diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index b0696653..1451ab9b 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -181,6 +181,7 @@ namespace Newtonsoft.Json.Tests.Serialization }", strJsonMainClass); } +#if !(PORTABLE || PORTABLE40 || NET20 || NET35) [Test] public void LargeIntegerAsString() { @@ -199,6 +200,7 @@ namespace Newtonsoft.Json.Tests.Serialization { public string Blah { get; set; } } +#endif [Test] public void CaseInsensitiveRequiredPropertyConstructorCreation() diff --git a/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs b/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs index dd684942..7f208254 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs @@ -86,14 +86,14 @@ namespace Newtonsoft.Json.Serialization if (property.DeclaringType != null && existingProperty.DeclaringType != null) { if (property.DeclaringType.IsSubclassOf(existingProperty.DeclaringType) - || (existingProperty.DeclaringType.IsInterface && property.DeclaringType.ImplementInterface(existingProperty.DeclaringType))) + || (existingProperty.DeclaringType.IsInterface() && property.DeclaringType.ImplementInterface(existingProperty.DeclaringType))) { // current property is on a derived class and hides the existing Remove(existingProperty); duplicateProperty = false; } if (existingProperty.DeclaringType.IsSubclassOf(property.DeclaringType) - || (property.DeclaringType.IsInterface && existingProperty.DeclaringType.ImplementInterface(property.DeclaringType))) + || (property.DeclaringType.IsInterface() && existingProperty.DeclaringType.ImplementInterface(property.DeclaringType))) { // current property is hidden by the existing so don't add it return; diff --git a/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs b/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs index e4bd1149..8f511546 100644 --- a/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs +++ b/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs @@ -553,13 +553,12 @@ namespace Newtonsoft.Json.Utilities public static bool ImplementInterface(this Type type, Type interfaceType) { - for (Type currentType = type; currentType != null; currentType = currentType.BaseType) + for (Type currentType = type; currentType != null; currentType = currentType.BaseType()) { - Type[] interfaces = currentType.GetInterfaces(); - - for (int i = 0; i < interfaces.Length; i++) + IEnumerable interfaces = currentType.GetInterfaces(); + foreach (Type i in interfaces) { - if (interfaces[i] == interfaceType || (interfaces[i] != null && interfaces[i].ImplementInterface(interfaceType))) + if (i == interfaceType || (i != null && i.ImplementInterface(interfaceType))) { return true; }