尝试在macOS High Sierra上构建一个简单的F#项目时出错。
$ mono --version
Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Sun Sep 17 18:29:46 BST 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
步骤:
$ mono .paket/paket.exe install
$ ./build.sh
错误是:
1) System.Exception: dotnet build failed
at FSI_0005.Build+runDotnet@40.Invoke (System.String message) [0x00001] in <c9993ec69ddb4848af99438005012ea7>:0
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a) [0x00038] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5893d081904cf4daa745038381d09358>:0
at FSI_0005.Build.runDotnet (System.String workingDir, System.String args) [0x00048] in <c9993ec69ddb4848af99438005012ea7>:0
at FSI_0005.Build+clo@64-6.Invoke (System.String p) [0x0000a] in <c9993ec69ddb4848af99438005012ea7>:0
at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] action, System.Collections.Generic.IEnumerable`1[T] source) [0x0002d] in <5893d081904cf4daa745038381d09358>:0
at FSI_0005.Build+clo@62-5.Invoke (Microsoft.FSharp.Core.Unit _arg4) [0x0000b] in <c9993ec69ddb4848af99438005012ea7>:0
at Fake.TargetHelper+targetFromTemplate@209-1[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00001] in <59b649fdccf1c534a7450383fd49b659>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x0004b] in <59b649fdccf1c534a7450383fd49b659>:0
我怎样才能使这个工作?
答案 0 :(得分:1)
Ionide默认没有选择正确的目标框架。
您需要进行以下更改:
要*.fsproj
,请将目标框架更改为:
<TargetFramework>netcoreapp2.0</TargetFramework>
要paket.dependencies
,请将框架更改为:
framework: >= netcoreapp2.0
再次运行Paket:
$ mono .paket/paket.exe install
再次运行构建脚本:
$ ./build.sh