Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net core 能否使用.net core运行F#脚本文件(.fsx)?_.net Core_F#_Mono - Fatal编程技术网

.net core 能否使用.net core运行F#脚本文件(.fsx)?

.net core 能否使用.net core运行F#脚本文件(.fsx)?,.net-core,f#,mono,.net Core,F#,Mono,是否可以使用.net core运行.fsx文件?(相当于Mono上的fsharpi)我一直在寻找这个答案,我能找到的最好答案与你3月28日在Martimatix发表的评论相匹配,但我确实在VisualSharp repo中找到了第2407期,它跟踪了 更新(2009年4月): 现在似乎有一个.NET Core的预览版本可用。 他们正在研究它。同一篇由杰皮尔森发表的文章 您可以立即尝试以下方法: dotnet /usr/share/dotnet/sdk/2.1.403/FSharp/fsi.exe

是否可以使用.net core运行.fsx文件?(相当于Mono上的
fsharpi

我一直在寻找这个答案,我能找到的最好答案与你3月28日在Martimatix发表的评论相匹配,但我确实在VisualSharp repo中找到了第2407期,它跟踪了

更新(2009年4月): 现在似乎有一个.NET Core的预览版本可用。 他们正在研究它。同一篇由杰皮尔森发表的文章

您可以立即尝试以下方法:

dotnet /usr/share/dotnet/sdk/2.1.403/FSharp/fsi.exe test.fsx

它可以正常工作,但是缺少了一些部分,特别是对
#r
和交互式行编辑(readline)的全面支持。

在.NETCore v3.0或更高版本中,它可以开箱即用:

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

PS:旁注:如果你想编译你的脚本而不必运行它们,请检查(目前只有Linux/Mac兼容抱歉,我们接受PRs来添加Windows支持)。

你为此做了什么?我尝试了
fsi
,但它在.net core上还不可用-我听说团队将在某个阶段添加此功能。因此,目前我正在使用mono中的
fsharpi
。@Martimatix我知道这是一个老问题,但现在.NETCore3包含了这个现成的答案,最好切换接受的答案这里没有运气
pwsh PS C:\Users\info\Projects\Insights>dotnet fsi.\experience.fsx没有找到匹配命令“dotnet fsi”的可执行文件PS C:\Users\info\Projects\Insights>dotnet fsi.exe。\experience.fsx未找到匹配命令“dotnet fsi.exe”PS C:\Users\info\Projects\Insights>dotnet$(哪个fsi)。\experience.fsx未找到匹配命令“dotnet-/C/Program Files/dotnet/sdk/2.1.403/FSharp/fsi”