@@ -1959,6 +1959,10 @@ type FsiInteractionProcessor(tcConfigB,
19591959type DummyForm () =
19601960inherit Form()
19611961member x.DoCreateHandle () = x.CreateHandle()
1962+ /// Creating the dummy form object can crash on Mono Mac, and then prints a nasty background
1963+ /// error during finalization of the half-initialized object...
1964+ override x.Finalize () = ()
1965+
19621966
19631967/// This is the event loop implementation for winforms
19641968type WinFormsEventLoop ( fsiConsoleOutput : FsiConsoleOutput , lcid : int option ) =
@@ -2460,8 +2464,14 @@ type internal FsiEvaluationSession (argv:string[], inReader:TextReader, outWrite
24602464();
24612465
24622466// This is the event loop for winforms
2463- fsi.EventLoop<- WinFormsEventLoop( fsiConsoleOutput, fsiOptions.FsiLCID)
2464-
2467+ try fsi.EventLoop<- WinFormsEventLoop( fsiConsoleOutput, fsiOptions.FsiLCID)
2468+ with e->
2469+ printfn" Your system doesn't seem to support WinForms correctly. You will"
2470+ printfn" need to set fsi.EventLoop use GUI windows from F# Interactive."
2471+ printfn" You can set different event loops for MonoMac, Gtk#, WinForms and other"
2472+ printfn" UI toolkits. Drop the --gui argument if no event loop is required." "
2473+
2474+
24652475 istateRef := fsiInteractionProcessor.LoadInitialFiles (exitViaKillThread, !istateRef)
24662476
24672477 StartStdinReadAndProcessThread(fsiOptions.FsiLCID, istateRef, errorLogger, fsiConsoleInput, fsiConsoleOutput, fsiStdinLexerProvider, fsiInteractionProcessor, exitViaKillThread)