Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin studio fails to open F# files

I've just installed Xamarin studio to try out the F# experience on OSX. The install works fine and I'm able to create the F# tutorial project, but when it tries to open the Tutorial.fs file I get the following message:

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 

Double clicking on the file also results in the above message. The file is visible in Xamarin studio. I can run the tutorial project and it opens up a terminal and executes the file, if I'm using mono 3.0.10. I'm using the xamarin studio version 4.0.4 and have both mono 3.0.10 and 2.10.12 installed.

There is one more thing that I don't understand that might be related and that is under references I have a warning that FSharp.Core is not available for Mono / .NET 4.0 (in mono 3.0.10). I thought that would stop me from running the file but it wasn't that's why I'm not sure if it is related or not.

like image 845
Tomas Jansson Avatar asked May 07 '13 06:05

Tomas Jansson


People also ask

Does Xamarin support F#?

F# is available as a programming language to Xamarin users on all of the Xamarin-supported platforms: Android, macOS, and iOS.

Will Xamarin be discontinued?

In May 2020, Microsoft announced that Xamarin. Forms, a major component of its mobile app development framework, would be deprecated in November 2021 in favour of a new .

Is Xamarin being replaced by Maui?

Forms. . NET Multi-platform App UI (MAUI) is a multi-platform technology for developing mobile (iOS and Android) and desktop (Windows and Mac) applications.

Is Microsoft sunsetting Xamarin?

In terms of sunsetting the Xamarin Community Toolkit, the company will continue to support it through November 2022. It will accept pull requests for bug fixes through the time, but it will only accept pull requests to add new features through September 2021.


1 Answers

I think you need to use the latest version of the F# binding as that error was a breaking change between version 4.0.1 and 4.0.3 of Xamarin Studio.

You dont specify what version you are currently using but if you use latest version from either the addin channel or manually: F# binding 3.2.15 everything should be working ok.

The FSharp.Core issue you mentioned is also a known issue.

like image 173
7sharp9 Avatar answered Sep 27 '22 23:09

7sharp9