You can load packages into a .NET notebook from NuGet using the following syntax:
#r "nuget:<package name>[,<package version>]"
If you don't provide an explicit package version, the latest available non-preview version will be loaded.
Here's an example:
#r "nuget:System.Reactive.Linq, 4.1.5"
Now that the package is loaded, we can add some using
statements and write some code.
using System.Reactive;
using System.Reactive.Linq;
using System.Reactive.Concurrency;
var output = display("Counting...");
var sub = Observable
.Interval(TimeSpan.FromSeconds(.5), CurrentThreadScheduler.Instance)
.Take(10)
.Subscribe(i => output.Update(i));
If you want to load an assembly that's already on disk, you can do so using this syntax:
#r "<path to .dll>"
You can load a C# script (typically a .csx
file) into the notebook using this syntax:
#load "<path to .csx file>"
#load "something.csx"