Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Cann't open .fs files in MonoDevelop 2.4.2 #18

Closed
o01eg opened this issue May 12, 2011 · 6 comments
Closed

Cann't open .fs files in MonoDevelop 2.4.2 #18

o01eg opened this issue May 12, 2011 · 6 comments
Milestone

Comments

@o01eg
Copy link

o01eg commented May 12, 2011

When I try to open .fs files from F# projects I get exception.

ERROR [2011-05-12 12:28:21Z]: System.TypeInitializationException: An exception was thrown by the type initializer for FSharp.MonoDevelop.LanguageService ---> System.TypeInitializationException: An exception was thrown by the type initializer for <StartupCode$FSharpBinding>.$LanguageService ---> System.TypeInitializationException: An exception was thrown by the type initializer for FSharpCompiler ---> System.TypeInitializationException: An exception was thrown by the type initializer for <StartupCode$FSharpBinding>.$FSharpCompiler ---> System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a19089b1c74d0809' or one of its dependencies. The system cannot find the file specified.
File name: 'FSharp.Compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a19089b1c74d0809'
at System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, Boolean refonly) [0x00000] in :0
at System.AppDomain.Load (System.String assemblyString) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (string)
at System.Reflection.Assembly.Load (System.String assemblyString) [0x00000] in :0
at <StartupCode$FSharpBinding>.$FSharpCompiler..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at Microsoft.FSharp.Compiler.Reflection+FSharpCompiler..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at Microsoft.FSharp.Compiler.SourceCodeServices+InteractiveChecker.Create (Microsoft.FSharp.Core.FSharpFunc`2 dirty) [0x00000] in :0
at FSharp.MonoDevelop.LanguageService..ctor () [0x00000] in :0
at <StartupCode$FSharpBinding>.$LanguageService..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at FSharp.MonoDevelop.LanguageService..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at FSharp.MonoDevelop.FSharpParser.Parse (MonoDevelop.Projects.Dom.Parser.ProjectDom dom, System.String fileName, System.String fileContent) [0x00000] in :0
at MonoDevelop.Projects.Dom.Parser.ProjectDomService.DoParseFile (MonoDevelop.Projects.Dom.Parser.ProjectDom dom, System.String fileName, System.String fileContent) [0x00000] in :0
at MonoDevelop.Projects.Dom.Parser.ProjectDomService.ParseFile (MonoDevelop.Projects.Dom.Parser.ProjectDom dom, System.String fileName, MonoDevelop.Projects.Dom.Parser.ContentDelegate getContent) [0x00000] in :0
at MonoDevelop.Projects.Dom.Parser.ProjectDomService.ParseFile (MonoDevelop.Projects.Dom.Parser.ProjectDom dom, System.String fileName) [0x00000] in :0
at MonoDevelop.Projects.Dom.Parser.ProjectDomService.GetParsedDocument (MonoDevelop.Projects.Dom.Parser.ProjectDom dom, System.String fileName) [0x00000] in :0
at MonoDevelop.SourceEditor.SourceEditorView.Load (System.String fileName, System.String encoding) [0x00000] in :0
at MonoDevelop.SourceEditor.SourceEditorView.Load (System.String fileName) [0x00000] in :0
at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (System.String fileName) [0x00000] in :0

but FSharp.Compiler exist:

/usr/lib/mono/2.0/FSharp.Compiler.dll -> ../gac/FSharp.Compiler/2.0.0.0__b03f5f7f11d50a3a/FSharp.Compiler.dll
/usr/lib/mono/4.0/FSharp.Compiler.dll -> ../gac/FSharp.Compiler/4.0.0.0__b03f5f7f11d50a3a/FSharp.Compiler.dll

@funnelweb
Copy link
Contributor

This is because you have the Mono-released F# compiler in Mono 2.10

You have to adjust the explicit reference to this DLL in ./src/Services/FSharpCompiler.fs, replace the public key tokens on these lines:

./src/Services/FSharpCompiler.fs: static let asm = Assembly.Load("FSharp.Compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a19089b1c74d0809")

./src/Services/FSharpCompiler.fs: static let asm = Assembly.Load("FSharp.Compiler.Server.Shared, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a19089b1c74d0809")

Am working on getting this fix added to the release

@o01eg
Copy link
Author

o01eg commented Jul 29, 2011

Look as fixed. Now when I try to open .fs files I get another exception:

System.TypeLoadException: Could not load type 'System.Collections.IStructuralEquatable' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

What about bug with System.Lazy when I try to do any doings with projects?

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'System.Lazy1' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Reflection.ConstructorInfo.Invoke (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 <filename unknown>:0 at Mono.Addins.InstanceExtensionNode.GetInstance () [0x00000] in <filename unknown>:0 at MonoDevelop.Projects.Extensions.LanguageBindingCodon.get_LanguageBinding () [0x00000] in <filename unknown>:0 at MonoDevelop.Projects.LanguageBindingService.<CheckBindings>m__6B (MonoDevelop.Projects.Extensions.LanguageBindingCodon codon) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator102[MonoDevelop.Projects.Extensions.LanguageBindingCodon,MonoDevelop.Projects.ILanguageBinding].MoveNext () [0x00000] in :0
at System.Collections.Generic.List1[MonoDevelop.Projects.ILanguageBinding].AddEnumerable (IEnumerable1 enumerable) [0x00000] in :0
at System.Collections.Generic.List1[MonoDevelop.Projects.ILanguageBinding]..ctor (IEnumerable1 collection) [0x00000] in :0
at MonoDevelop.Projects.LanguageBindingService.CheckBindings () [0x00000] in :0
at MonoDevelop.Projects.LanguageBindingService.GetBindingPerLanguageName (System.String language) [0x00000] in :0
at MonoDevelop.Projects.DotNetProject.FindLanguage (System.String name) [0x00000] in :0
at MonoDevelop.Projects.DotNetProject..ctor (System.String languageName) [0x00000] in :0
at MonoDevelop.Projects.DotNetProject..ctor (System.String languageName, MonoDevelop.Projects.ProjectCreateInformation projectCreateInfo, System.Xml.XmlElement projectOptions) [0x00000] in :0
at MonoDevelop.Projects.DotNetAssemblyProject..ctor (System.String languageName, MonoDevelop.Projects.ProjectCreateInformation projectCreateInfo, System.Xml.XmlElement projectOptions) [0x00000] in :0
at MonoDevelop.Projects.DotNetProjectBinding.CreateProject (System.String languageName, MonoDevelop.Projects.ProjectCreateInformation info, System.Xml.XmlElement projectOptions) [0x00000] in :0
at MonoDevelop.Projects.DotNetProjectBinding.CreateProject (MonoDevelop.Projects.ProjectCreateInformation info, System.Xml.XmlElement projectOptions) [0x00000] in :0
at MonoDevelop.Projects.ProjectService.CreateProject (System.String type, MonoDevelop.Projects.ProjectCreateInformation info, System.Xml.XmlElement projectOptions) [0x00000] in :0
at MonoDevelop.Ide.Templates.ProjectDescriptor.CreateItem (MonoDevelop.Projects.ProjectCreateInformation projectCreateInformation, System.String defaultLanguage) [0x00000] in :0
at MonoDevelop.Ide.Templates.ProjectTemplate.HasItemFeatures (MonoDevelop.Projects.SolutionFolder parentFolder, MonoDevelop.Projects.ProjectCreateInformation cinfo) [0x00000] in :0
at MonoDevelop.Ide.Projects.NewProjectDialog.SelectedIndexChange (System.Object sender, System.EventArgs e) [0x00000] in :0
at MonoDevelop.Ide.Projects.NewProjectDialog+TemplateView.m__34 (System.Object , System.EventArgs ) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in :0
at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in :0
at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in :0
at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in :0

@funnelweb
Copy link
Contributor

Looks like another issue with Mono 2.10. Can you use Mono 2.8?

@funnelweb
Copy link
Contributor

btw what did you change those lines in ./src/Services/FSharpCompiler.fs to?

@o01eg
Copy link
Author

o01eg commented Jul 29, 2011

I change PublicKeyToken=a19089b1c74d0809 into b03f5f7f11d50a3a

@funnelweb
Copy link
Contributor

Very old issue, closing this out

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants