Can you run an F# script file (.fsx) using .net core?

I went looking for this answer and the best I could find matches your comment @Martimatix from March 28 however I did find issue 2407 in the visualfsharp repo which tracks the support for fsi on .NET Core 2.0.

Update (April 2009): It looks like there is now a preview version now for .NET Core available. https://devblogs.microsoft.com/dotnet/announcing-net-core-3-preview-3/


It works out of the box in .NETCore v3.0 or newer:

$ cat hello.fsx
#!/usr/bin/env fsharpi
printfn "hello world"
$ dotnet fsi hello.fsx
hello world
$ dotnet --version
3.0.100

PS: Side-note: if you want to compile your scripts without having to run them, check this tool (only Linux/Mac compatible for now sorry, we accept PRs to add Windows support).

Tags:

F#

Mono

.Net Core