pracuję na przykładzie Osadzanie F # Interactive z http://fsharp.github.io/FSharp.Compiler.Service/interactive.html ale mam problem z następującą linią wyrzucanie wyjątek:Osadzanie F # Interaktywna Przykład rzucanie wyjątek od FSharp.Compiler.Service
let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream)
Wyjątkiem jest wyrzucane :
"wystąpił nieobsługiwany wyjątek typu 'System.Exception' wystąpił w FSharp.Compiler.Service.dll informacje dodatkowe: błąd podczas tworzenia sesji testowej: StopProcessing null"
Mój projekt jest uruchamiany z VS2015 Enterprise Update 1, skonfigurowany jako prosta aplikacja konsoli F #, z runtime Target F # będącym F # 4.0 z Target Framework jako 4.6. Wersja FSharp.Compiler.Service pobrana z nuget to 2.0.0.2.
Kod plik Program.Fs Używam jest tutaj (bezpośredni port przykład):
open System
open System.IO
open System.Text
open Microsoft.FSharp.Compiler.SourceCodeServices
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:\\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
Wszelkie myśli będą mile widziane.
[Czym są F # pliki FSharp.Core.optdata i FSharp.Core.sigdata?] (Http://stackoverflow.com/questions/21224314/what-are-fs-fsharp-core-optdata-and-fsharp- core-sigdata-files) –