diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 00692c7f12..c4a1fe47ce 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,3 +1,6 @@
+#### 5.7.2 - 17.07.2017
+* BUGFIX: Version in path and load scripts should work together - https://github.com/fsprojects/Paket/issues/2534
+
#### 5.7.1 - 17.07.2017
* BUGFIX: Detect subfolders like "Lib" - https://github.com/fsprojects/Paket/issues/2533
diff --git a/src/Paket.Core/Dependencies/NuGet.fs b/src/Paket.Core/Dependencies/NuGet.fs
index 695c08440c..a872ddb848 100644
--- a/src/Paket.Core/Dependencies/NuGet.fs
+++ b/src/Paket.Core/Dependencies/NuGet.fs
@@ -85,8 +85,12 @@ let ofFiles filesList =
|> Seq.fold (fun state file -> addContent file state) []
let GetContent dir =
+ let di = DirectoryInfo(dir)
+ if not di.Exists then
+ failwithf "%s doesn't exist. nuspec file can't be loaded." di.FullName
+
let spec =
- DirectoryInfo(dir).EnumerateFiles("*.nuspec", SearchOption.TopDirectoryOnly)
+ di.EnumerateFiles("*.nuspec", SearchOption.TopDirectoryOnly)
|> Seq.exactlyOne
|> fun f -> Nuspec.Load(f.FullName)
{ Content = (ofDirectory dir).Contents
diff --git a/src/Paket.Core/PaketConfigFiles/DependencyCache.fs b/src/Paket.Core/PaketConfigFiles/DependencyCache.fs
index dc6e91f589..e7bffb3df8 100644
--- a/src/Paket.Core/PaketConfigFiles/DependencyCache.fs
+++ b/src/Paket.Core/PaketConfigFiles/DependencyCache.fs
@@ -184,24 +184,27 @@ type DependencyCache (dependencyFile:DependenciesFile, lockFile:LockFile) =
member __.SetupGroup (groupName:GroupName) : bool =
if loadedGroups.Contains groupName then true else
- match tryGet groupName orderedGroupCache with
+ match tryGet groupName orderedGroupCache with
| None -> false
| Some resolvedPackageList ->
let exprs =
if resolvedPackageList <> [] then
if verbose then
verbosefn "[ Loading packages from group - %O ]\n" groupName
- resolvedPackageList |> List.map (fun package -> async {
+ resolvedPackageList
+ |> List.map (fun package -> async {
let packageName = package.Name
- let groupFolder = if groupName = Constants.MainDependencyGroup then "" else "/" + groupName.CompareString
- let folder = DirectoryInfo(sprintf "%s/packages%s/%O" lockFile.RootPath groupFolder packageName)
- let nuspecShort = sprintf "/packages%s/%O/%O.nuspec" groupFolder packageName packageName
+ let folder =
+ getTargetFolder lockFile.RootPath groupName packageName package.Version (defaultArg package.Settings.IncludeVersionInPath false)
+ |> Path.GetFullPath
+
+ let nuspecShort = Path.Combine(folder, sprintf "%O.nuspec" packageName)
if verbose then
verbosefn " -- %s" nuspecShort
let nuspec = FileInfo <| Path.Combine (lockFile.RootPath,nuspecShort)
let nuspec = Nuspec.Load nuspec.FullName
nuspecCache.TryAdd((package.Name,package.Version),nuspec)|>ignore
- let content = NuGet.GetContent(folder.FullName)
+ let content = NuGet.GetContent(folder)
let model = InstallModel.CreateFromContent(packageName, package.Version, Paket.Requirements.FrameworkRestriction.NoRestriction, content)
installModelCache.TryAdd((groupName,package.Name) , model) |> ignore
}) |> Array.ofSeq
diff --git a/src/Paket.Core/PublicAPI.fs b/src/Paket.Core/PublicAPI.fs
index 2e994b0aaf..9815aad202 100644
--- a/src/Paket.Core/PublicAPI.fs
+++ b/src/Paket.Core/PublicAPI.fs
@@ -449,9 +449,11 @@ type Dependencies(dependenciesFileName: string) =
| None -> failwithf "Package %O is not installed in group %O." packageName groupName
| Some resolvedPackage ->
let packageName = resolvedPackage.Name
- let groupFolder = if groupName = Constants.MainDependencyGroup then "" else "/" + groupName.CompareString
- let folder = DirectoryInfo(sprintf "%s/packages%s/%O" this.RootPath groupFolder packageName)
- let content = NuGet.GetContent(folder.FullName)
+ let folder =
+ getTargetFolder this.RootPath groupName packageName resolvedPackage.Version (defaultArg resolvedPackage.Settings.IncludeVersionInPath false)
+ |> Path.GetFullPath
+
+ let content = NuGet.GetContent folder
InstallModel.CreateFromContent(packageName, resolvedPackage.Version, Paket.Requirements.FrameworkRestriction.NoRestriction, content)
/// Returns all libraries for the given package and framework.
diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj
index 62f8f6df64..4facbaad05 100644
--- a/src/Paket/Paket.fsproj
+++ b/src/Paket/Paket.fsproj
@@ -31,8 +31,8 @@
Project
paket.exe
Project
- update
- C:\proj\testing\
+ install
+ D:\temp\test
true
@@ -42,8 +42,8 @@
3
- convert-from-nuget
- D:\temp\convert\PaketReferenceBug
+ install -v
+ D:\temp\test
14.0