diff --git a/src/XMakeBuildEngine/UnitTests/Construction/ElementLocation_Tests.cs b/src/XMakeBuildEngine/UnitTests/Construction/ElementLocation_Tests.cs index 2ed1a695026..6dcc3cc7962 100644 --- a/src/XMakeBuildEngine/UnitTests/Construction/ElementLocation_Tests.cs +++ b/src/XMakeBuildEngine/UnitTests/Construction/ElementLocation_Tests.cs @@ -103,11 +103,7 @@ public void Equality() /// Check it will use large element location when it should. /// Using file as BIZARRELY XmlTextReader+StringReader crops or trims. /// -#if RUNTIME_TYPE_NETCORE - [Fact(Skip = "https://github.com/Microsoft/msbuild/issues/270")] -#else [Fact] -#endif public void TestLargeElementLocationUsedLargeColumn() { string file = null; @@ -135,11 +131,7 @@ public void TestLargeElementLocationUsedLargeColumn() /// Check it will use large element location when it should. /// Using file as BIZARRELY XmlTextReader+StringReader crops or trims. /// -#if RUNTIME_TYPE_NETCORE - [Fact(Skip = "https://github.com/Microsoft/msbuild/issues/270")] -#else [Fact] -#endif public void TestLargeElementLocationUsedLargeLine() { string file = null; diff --git a/src/XMakeBuildEngine/Xml/ProjectXmlUtilities.cs b/src/XMakeBuildEngine/Xml/ProjectXmlUtilities.cs index 79a2b26cbc5..9a551bedffd 100644 --- a/src/XMakeBuildEngine/Xml/ProjectXmlUtilities.cs +++ b/src/XMakeBuildEngine/Xml/ProjectXmlUtilities.cs @@ -50,6 +50,13 @@ private static List GetChildElements(XmlElementWithLocat break; default: + if (child.NodeType == XmlNodeType.Text && String.IsNullOrWhiteSpace(child.InnerText)) + { + // If the text is greather than 4k and only contains whitespace, the XML reader will assume it's a text node + // instead of ignoring it. Our call to String.IsNullOrWhiteSpace() can be a little slow if the text is + // large but this should be extremely rare. + break; + } if (throwForInvalidNodeTypes) { ThrowProjectInvalidChildElement(child.Name, element.Name, element.Location);