Logo Paket

paket generate-load-scripts

Generate F# and C# include scripts that reference installed packages in a interactive environment like F# Interactive or ScriptCS.

paket generate-load-scripts [--help] [--group <name>] [--framework <framework>] [--type <csx|fsx>]

OPTIONS:

    --group, -g <name>    groups to generate scripts for (default: all groups); may be repeated
    --framework, -f <framework>
                          framework identifier to generate scripts for, such as net45 or
                          netstandard1.6; may be repeated
    --type, -t <csx|fsx>  language to generate scripts for; may be repeated
    --silent, -s          suppress console output
    --verbose, -v         print detailed information to the console
    --log-file <path>     print output to a file
    --help                display this list of options.

If you add the --verbose flag Paket will run in verbose mode and show detailed information.

With --log-file [path] you can trace the logged information into a file.

Generate load scripts for all NuGet packages

It is possible to generate load scripts for all registered NuGet packages defined in the paket.dependencies file.

paket generate-load-scripts --framework net45

This will create .csx and .fsx scripts under .paket/load/net45/. Those files can now be loaded in your scripts without having to bother with the list and order of all dependencies for given package.

The generated load scripts will reference DLLs from the packages using #r. Additionally, all scripts in a loadscripts directory in the package will be referenced by #load, as will any script PackageName.fsx or PackageName.csx in the root of the package.

Notes:

Generate load scripts while installing packages

Alternatively, load scripts can be generated automatically while running the paket install command.

To enable this feature, add the generate_load_scripts option to the paket.dependencies file

generate_load_scripts: true
source https://nuget.org/api/v2

nuget Suave

Example

Consider the following paket.dependencies file:

source https://nuget.org/api/v2

nuget FsLab

Now we run paket install to install the package.

Then we run paket generate-load-scripts --framework net45 to generate include scripts.

In a .fsx script file you can now use

#load @".paket/load/net45/fslab.fsx"

// Now you are ready to use FsLab and any of its dependencies.

Type something to start searching.