Support ancient .NET in Skippers

This commit is contained in:
Matt Nadareski
2024-02-28 20:31:22 -05:00
parent c6df7980a8
commit 080c8a749b
5 changed files with 27 additions and 6 deletions

View File

@@ -79,7 +79,11 @@ namespace SabreTools.Skippers
var xts = new XmlSerializer(typeof(Detector));
// Get skippers for each known header type
#if NET20 || NET35
foreach (string skipperPath in Directory.GetFiles(LocalPath, "*"))
#else
foreach (string skipperPath in Directory.EnumerateFiles(LocalPath, "*", SearchOption.AllDirectories))
#endif
{
try
{
@@ -87,7 +91,9 @@ namespace SabreTools.Skippers
var xtr = XmlReader.Create(skipperPath, new XmlReaderSettings
{
CheckCharacters = false,
#if NET40_OR_GREATER
DtdProcessing = DtdProcessing.Ignore,
#endif
IgnoreComments = true,
IgnoreWhitespace = true,
ValidationFlags = XmlSchemaValidationFlags.None,