diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XmlnsCache.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XmlnsCache.cs index 03fe3eb9ce9..0d8d8ff9139 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XmlnsCache.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XmlnsCache.cs @@ -12,6 +12,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; +using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Security; @@ -93,7 +94,7 @@ private void AddReferencedAssemblies() List interestingAssemblies = new List(); // Load all the assemblies into a list. - foreach(string assemblyName in _assemblyPathTable.Keys) + foreach(string assemblyName in _assemblyPathTable.Keys.OfType().OrderBy(s => s, StringComparer.Ordinal)) { bool hasCacheInfo = true; Assembly assy;