I am working on an Embedding F # Interactive example from here , but here's how post I had a problem with the following line throwing an exception:
let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream)
The exception is:
"System.Exception: 'Error creating evaluation session: StopProcessingExn None'"
My project starts from VS2017 Enterprise, it is configured as a simple F # console application, and the Target Framework as .NET Core 2.0 . The version of FSharp.Compiler.Service downloaded from nuget is 17.0.1, and FSharp.Core is 4.2.0.
The code of the Program.Fs file that I run is here (direct port example):
open System open System.IO open System.Text open Microsoft.FSharp.Compiler.Interactive.Shell [<EntryPoint>] let main argv = let sbOut = new StringBuilder() let sbErr = new StringBuilder() let inStream = new StringReader("") let outStream = new StringWriter(sbOut) let errStream = new StringWriter(sbErr) // Build command line arguments & start FSI session let argv = [| "C:\\Program Files (x86)\\Microsoft SDKs\\F#\\4.1\\Framework\\v4.0\\fsi.exe" |] let allArgs = Array.append argv [|"--noninteractive"|] let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream) /// Evaluate expression & return the result let evalExpression text = match fsiSession.EvalExpression(text) with | Some value -> printfn "%A" value.ReflectionValue | None -> printfn "Got no result!" evalExpression "42+1" // prints '43' Console.ReadLine() |> ignore 0 // return integer
I already tried to add the files FSharp.Core.optdata and FSharp.Core.sigdata to the bin folder (bin \ Debug \ netcoreapp2.0), as mentioned here and here , but to no avail. By the way, my bin folder does not contain the FSharp.Core.dll file.
I also tried to publish my application and add the .optdata and .sigdata manually to the publish folder, but without success.
Any thoughts would be appreciated.
source share