Skip to content

Commit

Permalink
Fix detection of framework version with spaces
Browse files Browse the repository at this point in the history
Fixes #1790

Fixes compatibility with packages such as MarkdownDeep.NET which have the
internal folder structure of

    ./lib/.NetFramework 3.5/MarkdownDeep.dll

Resolve this issue by adding an alias to remove spaces in the framework string.
  • Loading branch information
danielrbradley committed Jul 6, 2016
1 parent be14185 commit 8c17c3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Paket.Core/FrameworkHandling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ module KnownAliases =
".netportable", "portable"
"netportable", "portable"
"0.0", ""
".", "" ]
".", ""
" ", "" ]
|> List.map (fun (p,r) -> p.ToLower(),r.ToLower())


Expand Down
4 changes: 4 additions & 0 deletions tests/Paket.Tests/ProjectFile/ConditionSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ let ``should detect net45-full``() =
let ``should detect net``() =
FrameworkDetection.DetectFromPath(@"..\packages\RhinoMocks\lib\net\Rhino.Mocks.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2))

[<Test>]
let ``should detect with spaces``() =
FrameworkDetection.DetectFromPath(@"..\packages\FSharpx.Core\lib\.NetFramework 3.5\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5))

[<Test>]
let ``should detect 35, 40 and 45``() =
FrameworkDetection.DetectFromPath(@"..\packages\FSharpx.Core\lib\35\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5))
Expand Down

0 comments on commit 8c17c3d

Please sign in to comment.