fsprojects / zarchive-fsharpbinding

Archive of F# Language Bindings for Open Editors
Other
307 stars 106 forks source link

Exception is thrown on the XS title screen if you select the Edit menu. #404

Closed 7sharp9 closed 10 years ago

7sharp9 commented 10 years ago

Windows 7 with VS2010/2012 installed. Windows XS 4.2.4 build 281 F# Addin 3.2.26

On the title screen select the Edit menu, exception below occurs before XS closes.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: No path to F# Interactive console set, and default could not be located.
   at Microsoft.FSharp.Core.Operators.Raise[T](Exception exn)
   at MonoDevelop.FSharp.InteractiveSession..ctor()
   at MonoDevelop.FSharp.FSharpInteractivePad.setupSession()
   at MonoDevelop.FSharp.FSharpInteractivePad..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Mono.Addins.RuntimeAddin.CreateInstance(String typeName, Boolean throwIfNotFound)
   at MonoDevelop.Ide.Codons.PadCodon.CreatePad()
   at MonoDevelop.Ide.Codons.PadCodon.InitializePadContent(IPadWindow window)
   at MonoDevelop.Ide.Gui.PadWindow.CreateContent()
   at MonoDevelop.Ide.Gui.PadWindow.get_Content()
   at MonoDevelop.Ide.Gui.Pad.get_Content()
   at <StartupCode$FSharpBinding>.$FSharpInteractivePad.get_Fsi@297.Invoke(Pad pad)
   at MonoDevelop.FSharp.FSharpInteractivePad.get_Fsi()
   at MonoDevelop.FSharp.InteractiveCommand.Update(CommandInfo info)
   at MonoDevelop.Components.Commands.CommandHandler.InternalUpdate(CommandInfo info)
   at MonoDevelop.Components.Commands.CommandManager.DefaultUpdateCommandInfo(ActionCommand cmd, CommandInfo info)
   at MonoDevelop.Components.Commands.CommandManager.GetCommandInfo(Object commandId, CommandTargetRoute targetRoute)
7sharp9 commented 10 years ago

This occurs in 3.2.28 except you get a friendly warning about the path not being set, but it still crashes after that.

7sharp9 commented 10 years ago

It seems like the path detection in Windows is completely broken, can anyone else confirm this thats using a Windows system, maybe my Windows VM is hosed. I have VS2010/12 installed and fsi appears to be working ok there.

ghost commented 10 years ago

Works OK for me, but I have VS2013 installed

rneatherway commented 10 years ago

Same here. I will try it on a machine without VS2013 tomorrow.

Something I found a bit strange about the detection code is that it accepts an F# version to look for and we always pass in "LatestKnown" which is of course F# 3.1. If we don't have F# 3.1 on the machine then perhaps things go badly after that.

7sharp9 commented 10 years ago

It should really start at 3.1 and backtrack to whatever is installed I think.

On 16 Mar 2014, at 19:56, Robin Neatherway notifications@github.com wrote:

Same here. I will try it on a machine without VS2013 tomorrow.

Something I found a bit strange about the detection code is that it accepts an F# version to look for and we always pass in "LatestKnown" which is of course F# 3.1. If we don't have F# 3.1 on the machine then perhaps things go badly after that.

— Reply to this email directly or view it on GitHub.

rneatherway commented 10 years ago

Perhaps then these could be static members with an optional parameter for the framework. If the optional parameter isn't present then we probe for the highest as you suggest. What do you think?

7sharp9 commented 10 years ago

Yeah that might work. I would like portable, Monodroid and MonoTouch to also work with this scheme as they are also supported but not included in the default list. It makes it more tricky though as they are optionally installed too. I think this bit needs to be improved, at the moment I'm unsure on the optimal logic.

On 16 Mar 2014, at 21:37, Robin Neatherway notifications@github.com wrote:

Perhaps then these could be static members with an optional parameter for the framework. If the optional parameter isn't present then we probe for the highest as you suggest. What do you think?

— Reply to this email directly or view it on GitHub.

rneatherway commented 10 years ago

I just tested on a machine with VS2012 but not VS2013. It fails to find the compiler using LatestKnown, but works fine if I ask for FSharp_3_0. I will submit a PR that falls back to earlier versions to at least fix this bug.

ghost commented 10 years ago

Great!

7sharp9 commented 10 years ago

Cool, If that goes in Ill get it merged to vnext too. :-)

On 17 March 2014 15:34, Don Syme notifications@github.com wrote:

Great!

Reply to this email directly or view it on GitHubhttps://github.com/fsharp/fsharpbinding/issues/404#issuecomment-37829625 .

ghost commented 10 years ago

Reopening as the fix needs to be verified

7sharp9 commented 10 years ago

This works in my test environment now, closing. Thanks @rneatherway

rneatherway commented 10 years ago

Great, thanks for checking.