From 3d0d8c560d5f36fef0a634c519b2da9d582a6adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=BCneis?= Date: Mon, 10 Apr 2017 18:24:35 +0200 Subject: [PATCH] Fix rotating app.config entries when generating redirects --- src/Paket.Core/BindingRedirects.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/BindingRedirects.fs b/src/Paket.Core/BindingRedirects.fs index 5625a7d2f0..c3b1e7f20b 100644 --- a/src/Paket.Core/BindingRedirects.fs +++ b/src/Paket.Core/BindingRedirects.fs @@ -156,8 +156,9 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects (allKnownLi nsManager.AddNamespace("bindings", bindingNs) config.XPathSelectElements("//bindings:assemblyBinding", nsManager) |> Seq.collect (fun e -> e.Elements(XName.Get("dependentAssembly", bindingNs))) - |> Seq.filter (fun e -> isFirstGroup && (cleanBindingRedirects || isMarked e) && libIsContained e) - |> Seq.iter (fun e -> e.Remove()) + |> List.ofSeq // strict evaluation, as otherwise e.Remove() also changes the order! + |> List.filter (fun e -> isFirstGroup && (cleanBindingRedirects || isMarked e) && libIsContained e) + |> List.iter (fun e -> e.Remove()) let config = Seq.fold setRedirect config bindingRedirects indentAssemblyBindings config