diff --git a/XmlSchemaClassGenerator.Tests/MemoryOutputWriter.cs b/XmlSchemaClassGenerator.Tests/MemoryOutputWriter.cs index b9566417..a27d08c6 100644 --- a/XmlSchemaClassGenerator.Tests/MemoryOutputWriter.cs +++ b/XmlSchemaClassGenerator.Tests/MemoryOutputWriter.cs @@ -1,7 +1,9 @@ using System.CodeDom; using System.Collections.Generic; using System.IO; +using System.Runtime.Versioning; +[assembly:UnsupportedOSPlatform("ios")] namespace XmlSchemaClassGenerator.Tests { internal class MemoryOutputWriter : OutputWriter diff --git a/XmlSchemaClassGenerator/CodeUtilities.cs b/XmlSchemaClassGenerator/CodeUtilities.cs index a267ed2f..f41b8b2e 100644 --- a/XmlSchemaClassGenerator/CodeUtilities.cs +++ b/XmlSchemaClassGenerator/CodeUtilities.cs @@ -1,6 +1,7 @@ using System; using System.CodeDom; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Text.RegularExpressions; using System.Xml; @@ -360,7 +361,7 @@ public static KeyValuePair ParseNamespace(string nsArg, st return new KeyValuePair(new NamespaceKey(source, xmlNs), netNs); } - public static readonly List<(string Namespace, Func Condition)> UsingNamespaces = new() { + public static readonly ImmutableList<(string Namespace, Func Condition)> UsingNamespaces = ImmutableList.Create<(string Namespace, Func Condition)>( ("System", c => c.CompactTypeNames), ("System.CodeDom.Compiler", c => c.CompactTypeNames), ("System.Collections.Generic", c => c.CompactTypeNames), @@ -372,7 +373,7 @@ public static KeyValuePair ParseNamespace(string nsArg, st ("System.Xml", c => c.CompactTypeNames), ("System.Xml.Schema", c => c.CompactTypeNames), ("System.Xml.Serialization", c => c.CompactTypeNames) - }; + ); public static bool IsUsingNamespace(Type t, GeneratorConfiguration conf) => UsingNamespaces.Any(n => n.Namespace == t.Namespace && n.Condition(conf)); diff --git a/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj b/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj index 2894a8c3..21442858 100644 --- a/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj +++ b/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj @@ -48,6 +48,7 @@ +