我刚安装了Xamarin工作室,试用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工作室中可见。如果我使用mono 3.0.10,我可以运行教程项目并打开终端并执行文件。我正在使用xamarin studio 4.0.4版,并安装了mono 3.0.10和2.10.12。
还有一件我不明白的事情可能是相关的,并且在引用中我警告说FSharp.Core不适用于Mono / .NET 4.0(在mono 3.0.10中)。我认为这会阻止我运行文件,但这不是我不确定它是否相关的原因。
答案 0 :(得分:11)
我认为您需要使用最新版本的F#绑定,因为该错误是Xamarin Studio版本4.0.1和4.0.3之间的重大变化。
您没有指定当前使用的版本,但是如果您使用addin频道的最新版本或手动:F# binding 3.2.15一切都应该正常。
您提到的FSharp.Core问题也是known issue。
答案 1 :(得分:0)
我最近遇到过这个问题,直到我使用最新版本升级到alpha版本3.3后才能解决这个问题。