Skip to content

Commit

Permalink
Be more robust with custom namespaces in app.config - fixes #1607
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Feb 20, 2018
1 parent f096117 commit 1e74dfc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 5.138.3 - 2018-02-20
* BUGFIX: Be more robust with custom namespaces in app.config - https://github.com/fsprojects/Paket/issues/1607

#### 5.138.2 - 2018-02-20
* BUGFIX: Fix prerelease selection when having multiple prereleases - https://github.com/fsprojects/Paket/pull/3058

Expand Down
9 changes: 6 additions & 3 deletions src/Paket.Core/Common/Xml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ module Linq =
let node,ns = splitNode node
match parent |> tryGetElement ns node with
| None ->
let node = XElement(XName.Get(node, defaultArg ns ""))
parent.Add node
node :> XContainer
match parent.Nodes() |> Seq.tryFind (fun e -> match e with | :? XElement as e -> e.Name.LocalName = node | _ -> false) with
| Some existingNode -> existingNode :?> XContainer
| None ->
let node = XElement(XName.Get(node, defaultArg ns ""))
parent.Add node
node :> XContainer
| Some existingNode -> existingNode :> XContainer)
2 changes: 1 addition & 1 deletion src/Paket.Core/Installation/BindingRedirects.fs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects (allKnownLi
let needle = (sprintf "name=\"%s\"" b).ToLower()
haystack.Contains needle)

let nsManager = XmlNamespaceManager(NameTable());
let nsManager = XmlNamespaceManager(NameTable())
nsManager.AddNamespace("bindings", bindingNs)
config.XPathSelectElements("//bindings:assemblyBinding", nsManager)
|> Seq.collect (fun e -> e.Elements(XName.Get("dependentAssembly", bindingNs)))
Expand Down

0 comments on commit 1e74dfc

Please sign in to comment.