Skip to content

Commit

Permalink
Add a workaround for #2145
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Feb 17, 2017
1 parent 0dd8b8f commit 168972f
Show file tree
Hide file tree
Showing 2 changed files with 13 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 @@
#### 3.35.2 - 17.02.2017
* BUGFIX: Add a workaround for https://github.com/fsprojects/Paket/issues/2145

#### 3.35.1 - 31.01.2017
* BUGFIX: Ignore unknown frameworks - https://github.com/fsprojects/Paket/pull/2132

Expand Down
14 changes: 10 additions & 4 deletions src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ let getDetailsFromNuGetViaODataFast auth nugetURL (packageName:PackageName) (ver

/// Gets package details from NuGet via OData
let getDetailsFromNuGetViaOData auth nugetURL (packageName:PackageName) (version:SemVerInfo) =
let queryPackagesProtocol() =
let queryPackagesProtocol (packageName:PackageName) =
async {
let url = sprintf "%s/Packages(Id='%O',Version='%O')" nugetURL packageName version
let! response = safeGetFromUrl(auth,url,acceptXml)
Expand Down Expand Up @@ -295,11 +295,17 @@ let getDetailsFromNuGetViaOData auth nugetURL (packageName:PackageName) (version
let! result = getDetailsFromNuGetViaODataFast auth nugetURL packageName version
if String.containsIgnoreCase "visualstudio.com" nugetURL && result.Dependencies.IsEmpty then
// TODO: There is a bug in VSTS, so we can't trust this protocol. Remvoe when VSTS is fixed
return! queryPackagesProtocol()
return! queryPackagesProtocol packageName
else
return result
with _ -> return! queryPackagesProtocol()

with _ ->
try
return! queryPackagesProtocol packageName
with _ ->
// try uppercase version as workaround for https://github.com/fsprojects/Paket/issues/2145 - Bad!
let name = PackageName.ToString()
let uppercase = PackageName.ToString().[0].ToString().ToUpper() + name.Substring(1)
return! queryPackagesProtocol (PackageName uppercase)
}

let getDetailsFromNuGet force auth nugetURL packageName version =
Expand Down

0 comments on commit 168972f

Please sign in to comment.