diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs index 64baa319c..2c188a758 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs @@ -47,6 +47,10 @@ namespace Microsoft.PowerShell.Cmdletization ScriptWriter.s_xmlReaderSettings.MaxCharactersFromEntities = 16384; // generous guess for the upper bound ScriptWriter.s_xmlReaderSettings.MaxCharactersInDocument = 128 * 1024 * 1024; // generous guess for the upper bound +#if CORECLR // The XML Schema file 'cmdlets-over-objects.xsd' is missing in Github, and it's likely the resource string + //'CmdletizationCoreResources.Xml_cmdletsOverObjectsXsd' needs to be reworked to work in .NET Core. + ScriptWriter.s_xmlReaderSettings.DtdProcessing = DtdProcessing.Ignore; +#else ScriptWriter.s_xmlReaderSettings.DtdProcessing = DtdProcessing.Parse; // Allowing DTD parsing with limits of MaxCharactersFromEntities/MaxCharactersInDocument ScriptWriter.s_xmlReaderSettings.XmlResolver = null; // do not fetch external documents // xsd schema related settings @@ -58,6 +62,7 @@ namespace Microsoft.PowerShell.Cmdletization ScriptWriter.s_xmlReaderSettings.Schemas = new XmlSchemaSet(); ScriptWriter.s_xmlReaderSettings.Schemas.Add(null, cmdletizationSchemaReader); ScriptWriter.s_xmlReaderSettings.Schemas.XmlResolver = null; // do not fetch external documents +#endif } #endregion Static code reused for reading cmdletization xml