Xamarin MacOS X的F#:此工具集不支持TargetFrameworkVersionv4.5.2(ToolsVersion4.0)

时间:2016-04-02 16:31:18

标签: .net xamarin f# target-framework

我在VS2015上一直使用F#,但我买了我在MacOS X 10.11.3上运行的第一个(新)iMAC并安装了Xamarin 6.0(alpha版)。当我想在VS2015下编译一个正常的文件时,我正在遇到一些问题。

我在编辑中收到了警告

TargetFrameworkVersionv4.5.2 not supported by this toolset (ToolsVersion4.0) 

这是针对文件Microsoft.Common.Targets

..../Library/Frameworks/Mono.Frameworks/Version/4.4.0/Lib/Mono/4.5/Microsoft.Common.Targets

并且在运行时我收到了错误

at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, System.String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.IO/FileStream.cs:152 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) [0x00065] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/io/streamreader.cs:240 
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/io/streamreader.cs:221 
  at System.IO.StreamReader..ctor (System.String path, Boolean detectEncodingFromByteOrderMarks) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/io/streamreader.cs:202 
  at System.IO.StreamReader..ctor (System.String path) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/io/streamreader.cs:182 
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
  at System.IO.File.OpenText (System.String path) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.IO/File.cs:346 
  at System.IO.File.ReadAllLines (System.String path) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.IO/File.cs:515 
  at <StartupCode$Algo_Stanford>.$Knapsack_big.main@ () [0x0000d] in /Users/francois-guillaume.rideau/Documents/Learning-Fsharp/Algo Stanford/Algo Stanford/Knapsack_big.fs:20 

我该怎么办?

感谢

1 个答案:

答案 0 :(得分:2)

请将目标框架更改为.NET 4.5,因为Mono 4.x尚不支持4.5.2。