This is part of the Fake.DotNet.NuGet module.

Restore

Contains tasks which allow to restore NuGet packages from a NuGet package feed like nuget.org. There is also a tutorial about nuget package restore available.

Nested types and modules

TypeDescription
NugetRestoreVerbosity

RestorePackages Verbosity settings

RestorePackageParams

RestorePackages parameter path

RestoreSinglePackageParams

RestorePackages parameter path for single packages

Functions and values

Function or valueDescription
findNuget(defaultPath)
Signature: defaultPath:string -> string

Looks for NuGet.exe in [1] the specified defaultPath, [2] a list of standard tool folders, [3] any subfolder in the current directory, [4] the PATH - returns the first path where NuGet.exe was found.

RestoreMSSolutionPackages(...)
Signature: setParams:(RestorePackageParams -> RestorePackageParams) -> solutionFile:string -> unit

Restores the packages in the given solution file file from NuGet.

Parameters

  • setParams - Function used to manipulate the default NuGet parameters.
  • solutionFile - The microsoft sln file name.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
Target "RestorePackages" (fun _ ->
     "./src/Everything.sln"
     |> RestoreMSSolutionPackages (fun p ->
         { p with
             Sources = "http://myNugetSources.com" :: p.Sources
             OutputPath = outputDir
             Retries = 4 })
 )
RestorePackage setParams packageFile
Signature: setParams:(RestorePackageParams -> RestorePackageParams) -> packageFile:string -> unit

Restores the packages in the given packages.config file from NuGet.

Parameters

  • setParams - Function used to manipulate the default NuGet parameters.
  • packageFile - The packages.config file name.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
Target "RestorePackages" (fun _ ->
     "./src/ProjectA/packages.config"
     |> RestorePackage (fun p ->
         { p with
             Sources = "http://myNugetSources.com" :: p.Sources
             OutputPath = outputDir
             Retries = 4 })
 )
RestorePackageDefaults
Signature: RestorePackageParams

RestorePackage defaults parameters

RestorePackageId setParams packageId
Signature: setParams:(RestoreSinglePackageParams -> RestoreSinglePackageParams) -> packageId:string -> unit

Restores the given package from NuGet

RestorePackages()
Signature: unit -> unit

Restores all packages from NuGet to the default directories by scanning for packages.config files in any subdirectory.

RestoreSinglePackageDefaults
Signature: RestoreSinglePackageParams

RestoreSinglePackageParams defaults parameters