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..9f55e5daea7 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 @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Reflection; +using System.Linq; using System.Runtime.InteropServices; using System.Security; using System.Text; @@ -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)) { bool hasCacheInfo = true; Assembly assy;