我刚刚安装了 Xamarin studio 来试用 OSX 上的 F# 体验。安装工作正常,我可以创建 F# 教程项目,但是当它尝试打开 Tutorial.fs 文件时,我收到以下消息:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Mono.TextEditor.Highlighting.ResourceXmlProvider.Open'.
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
at Mono.Addins.TypeExtensionNode.CreateInstance () [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/TypeExtensionNode.cs:93
at MonoDevelop.SourceEditor.SyntaxModeCodon.get_SyntaxMode () [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeCodon.cs:42
at MonoDevelop.SourceEditor.SyntaxModeService+<SyntaxModeService>c__AnonStorey17.<>m__61 (Mono.TextEditor.TextDocument d) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeService.cs:45
at Mono.TextEditor.Highlighting.SyntaxModeProvider.Create (Mono.TextEditor.TextDocument doc) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs:839
at Mono.TextEditor.Highlighting.SyntaxModeService.GetSyntaxMode (Mono.TextEditor.TextDocument doc, System.String mimeType) [0x00036] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs:157
at MonoDevelop.SourceEditor.SourceEditorView.UpdateMimeType (System.String fileName) [0x00042] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:926
at MonoDevelop.SourceEditor.SourceEditorView.Load (System.String fileName, System.Text.Encoding loadEncoding) [0x00040] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:792
at MonoDevelop.SourceEditor.SourceEditorView.Load (System.String fileName) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:729
at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (System.String fileName) [0x00107] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:1181
双击该文件也会导致上述消息。该文件在 Xamarin 工作室中可见。如果我使用的是单声道 3.0.10,我可以运行教程项目并打开一个终端并执行文件。我正在使用 xamarin studio 4.0.4 版并安装了单声道 3.0.10 和 2.10.12。
还有一件事我不明白,这可能是相关的,在参考文献中我有一个警告,即 FSharp.Core 不适用于 Mono / .NET 4.0(在 mono 3.0.10 中)。我认为这会阻止我运行该文件,但这并不是我不确定它是否相关的原因。