【问题标题】:How to run F# interactive (fsi.exe) in dotnet core? Is it supported yet?如何在 dotnet core 中运行 F# 交互式(fsi.exe)?还支持吗?
【发布时间】:2016-09-05 10:11:43
【问题描述】:

我无法在 Windows 或 dotnetcore 上的 linux 中运行 find/run fsi.exe。它无处可寻。可能还不支持?

【问题讨论】:

  • 您是否找到了将 F# REPL 与 .NET Core 结合使用的方法?

标签: .net linux f# .net-core f#-interactive


【解决方案1】:

F# for CoreCLR Status 说 CoreCLR 上的 FSI 是完整的,所以如果能找到它大概会起作用。

在另一张罚单中 — Why were the C# and F# REPLs removed and when/how will it implemented "as a separate tool"? — 声称 dotnet repl fsi 曾经可以工作,但已被删除以支持(尚不存在的)单独的包。

【讨论】:

    【解决方案2】:

    如果我错了,请纠正我,但是,今天(19 年 12 月)
    f# 与 netcore 交互在 Ubuntu 18.04 中运行
    带有来自
    https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-1904
    的标准安装说明 和https://fsharp.org/use/linux/

    // file: runtime.fsx
    open System
    open System.Reflection
    open System.Runtime
    open System.Linq
    
    Type.GetType("Mono.Runtime")
    |> printf "Mono.Runtime: %A\n"
    (Assembly.GetEntryAssembly().GetCustomAttributesData()
             .FirstOrDefault((fun a -> 
                a.AttributeType = typedefof<Versioning.TargetFrameworkAttribute>)))
             .ConstructorArguments
    |> printf "Framework: %A\n"
    
    $ fsi runtime.fsx 
    Mono.Runtime: Mono.Runtime
    Framework: seq [".NETFramework,Version=v4.6"]
    

    ...

    $ dotnet fsi runtime.fsx 
    Mono.Runtime: <null>
    Framework: seq [".NETCoreApp,Version=v2.1"]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-23
      • 1970-01-01
      • 1970-01-01
      • 2021-02-23
      • 1970-01-01
      • 1970-01-01
      • 2016-10-09
      • 1970-01-01
      相关资源
      最近更新 更多