From 1b941fe0f3f2cf656da7b9a00a93621c3616137d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Guimar=C3=A3es?= Date: Thu, 29 Jul 2021 15:18:54 -0300 Subject: [PATCH 1/2] Fixing deterministic build bug with dotnet.exe (#4953) * adding orderby in foreach loop * Order references to make BAML deterministic Co-authored-by: Felipe da Conceicao Guimaraes Co-authored-by: Michael Dietrich --- .../PresentationFramework/System/Windows/Markup/XmlnsCache.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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..44ad95cdd33 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)) { bool hasCacheInfo = true; Assembly assy; From f8d67b07cc2680480b3fad38df0077254bddda3b Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Thu, 29 Jul 2021 16:40:22 -0300 Subject: [PATCH 2/2] adding optimization --- .../PresentationFramework/System/Windows/Markup/XmlnsCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 44ad95cdd33..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 @@ -94,7 +94,7 @@ private void AddReferencedAssemblies() List interestingAssemblies = new List(); // Load all the assemblies into a list. - foreach(string assemblyName in _assemblyPathTable.Keys.OfType().OrderBy(s => s)) + foreach(string assemblyName in _assemblyPathTable.Keys.OfType().OrderBy(s => s, StringComparer.Ordinal)) { bool hasCacheInfo = true; Assembly assy;