F# Can't install nugets because doesn't find default nuget source

I'm trying to install some nuget packages using vs code in F# interactive (fsx script). It has worked before because I have successfully installed FSharp.Data, but it seems to not work (anymore).

Following error

No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org (vs code)

Code

open System.IO
open System
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__


#r "nuget:System.Data.Linq.dll"
#r "nuget:FSharp.Data.SqlClient.dll"

A related issue says to list the nuget sources through commandline: Visual Studio 2019 F# NU1101 Unable to find package FSharp.core

When I do this I get a correct response:

enter image description here

So what is going on here?


Solution 1:

When You use nuget prefix in the #r directive, you don't have to add ".dll" extension at the end of package name. It is required only when you are referencing local dlls.

https://docs.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/