How to directly invoke F# compiler on .NET Core?

谁说我不能喝 提交于 2020-02-24 03:25:30

问题


UPD.:

I want to invoke F# compiler (i.e. fsc) from .NET Core SDK directly.

I know about dotnet build & co, but I don't want to involve them when I only need to compile a simple problem, i.e. in cases when fsc file.fs would be enough.

I've tried to search in .NET Core SDK (on my Mac, it was in /usr/local/share/dotnet/sdk/2.2.102/FSharp) and found a fsc.exe file there. Unfortunately, when I try to start it with dotnet /usr/local/share/dotnet/sdk/2.2.102/FSharp/fsc.exe, it gives me an error:

error FS0193: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Env.: macOS, .NET Core 2.2


回答1:


After install dotnet core (https://dotnet.microsoft.com/download) you should be able to build a F# project from the command line.

cd my-fs-project
dotnet build
dotnet run


来源:https://stackoverflow.com/questions/56835885/how-to-directly-invoke-f-compiler-on-net-core

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!