Skip to content

Commit

Permalink
NullReferenceException in applyBindingRedirects during "update nuget …
Browse files Browse the repository at this point in the history
…package" - fixes #1074
  • Loading branch information
forki committed Sep 21, 2015
1 parent d869b9b commit 8b606c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.3.1 - 21.09.2015
* BUGFIX: NullReferenceException in applyBindingRedirects during "update nuget package" - https://github.com/fsprojects/Paket/issues/1074

#### 2.3.0 - 21.09.2015
* Binding redirects from target platform only - https://github.com/fsprojects/Paket/pull/1070
* Allow to enable redirects per package - http://fsprojects.github.io/Paket/nuget-dependencies.html#redirects-settings
Expand Down
27 changes: 15 additions & 12 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -671,18 +671,21 @@ type ProjectFile =
KnownTargetProfiles.FindPortableProfile profile
| _ ->
let framework =
seq {for outputType in this.Document |> getDescendants "TargetFrameworkVersion" ->
outputType.InnerText }
|> Seq.map (fun s ->
let prefix =
match this.GetTargetFrameworkIdentifier() with
| None -> "net"
| Some x -> x

prefix + s.Replace("v","")
|> FrameworkDetection.Extract)
|> Seq.map (fun o -> o.Value)
|> Seq.tryHead
try
seq {for outputType in this.Document |> getDescendants "TargetFrameworkVersion" ->
outputType.InnerText }
|> Seq.map (fun s ->
let prefix =
match this.GetTargetFrameworkIdentifier() with
| None -> "net"
| Some x -> x

prefix + s.Replace("v","")
|> FrameworkDetection.Extract)
|> Seq.map (fun o -> o.Value)
|> Seq.tryHead
with
| _ -> None

SinglePlatform(defaultArg framework (DotNetFramework(FrameworkVersion.V4)))

Expand Down

0 comments on commit 8b606c5

Please sign in to comment.