@@ -320,7 +320,11 @@ type FsiStdinSyphon(errorWriter: TextWriter) =
320320
321321/// Clears the syphon text
322322member x.Reset () =
323+ #if FX_ ATLEAST_ 40
323324 syphonText.Clear() |> ignore
325+ #else
326+ syphonText.Remove( 0 , syphonText.Length) |> ignore
327+ #endif
324328
325329/// Adds a new line to the syphon text
326330member x.Add ( str : string ) =
@@ -433,7 +437,11 @@ type FsiCommandLineOptions(argv: string[], tcConfigB, fsiConsoleOutput: FsiConso
433437let mutable enableConsoleKeyProcessing =
434438// Mono on Win32 doesn't implement correct console processing
435439not ( runningOnMono&& System.Environment.OSVersion.Platform= System.PlatformID.Win32NT)
440+ #if MONO
441+ let mutable gui = false // override via "--gui", on by default
442+ #else
436443let mutable gui = true // override via "--gui", on by default
444+ #endif
437445#if DEBUG
438446let mutable showILCode = false // show modul il code
439447#endif
@@ -1414,7 +1422,11 @@ module MagicAssemblyResolution =
14141422// It is an explicit user trust decision to load an assembly with #r. Scripts are not run automatically (for example, by double-clicking in explorer).
14151423// We considered setting loadFromRemoteSources in fsi.exe.config but this would transitively confer unsafe loading to the code in the referenced
14161424// assemblies. Better to let those assemblies decide for themselves which is safer.
1425+ #if FX_ ATLEAST_ 40
14171426 Assembly.UnsafeLoadFrom( path)
1427+ #else
1428+ Assembly.LoadFrom( path)
1429+ #endif
14181430#endif // SILVERLIGHT
14191431let ResolveAssembly ( m , tcConfigB , tcImports : TcImports , fsiDynamicCompiler : FsiDynamicCompiler , fsiConsoleOutput : FsiConsoleOutput , fullAssemName : string ) =
14201432try
@@ -1468,9 +1480,11 @@ module MagicAssemblyResolution =
14681480| Some( OkResult( warns,[ r])) -> OkResult( warns, Choice1Of2 r.resolvedPath)
14691481| _ ->
14701482
1483+ #if EXTENSIONTYPING
14711484match tcImports.TryFindProviderGeneratedAssemblyByName( simpleAssemName) with
14721485| Some( assembly) -> OkResult([], Choice2Of2 assembly)
14731486| None->
1487+ #endif
14741488
14751489// Try to find the reference without an extension
14761490match tcImports.TryFindExistingFullyQualifiedPathFromAssemblyRef( ILAssemblyRef.Create( simpleAssemName, None, None, false , None, None)) with
@@ -2233,9 +2247,11 @@ type internal FsiEvaluationSession (argv:string[], inReader:TextReader, outWrite
22332247
22342248#if SILVERLIGHT
22352249#else
2250+ #if FX_ ATLEAST_ 40
22362251// set platform depending on whether the current process is a 64-bit process.
22372252// BUG 429882 : FsiAnyCPU.exe issues warnings (x64 v MSIL) when referencing 64-bit assemblies
22382253do tcConfigB.platform<- if System.Environment.Is64BitProcessthen Some AMD64else Some X86
2254+ #endif
22392255#endif
22402256
22412257let fsiStdinSyphon = new FsiStdinSyphon( errorWriter)
@@ -2339,9 +2355,11 @@ type internal FsiEvaluationSession (argv:string[], inReader:TextReader, outWrite
23392355
23402356#else
23412357let resolveType _fsiDynamicCompiler ( aref : ILAssemblyRef ) =
2358+ #if EXTENSIONTYPING
23422359match tcImports.TryFindProviderGeneratedAssemblyByName aref.Namewith
23432360| Some assembly-> Some( Choice2Of2 assembly)
23442361| None->
2362+ #endif
23452363match tcImports.TryFindExistingFullyQualifiedPathFromAssemblyRef arefwith
23462364| Some resolvedPath-> Some( Choice1Of2 resolvedPath)
23472365| None-> None