matthid/Yaaf.FSharp.Scripting

error while creating a fsi session

StefanBelo opened this issue · 6 comments

When debugging my app in VS (debug or release version) all works fine. After installing the released app it throws exception: "error while creating a fsi session"

What could go wrong?

I tried to run the app in admin privileges, but the same error occurs.

It's very likely that after installing the app we cannot find a FSharp.Core.dll. We try hard to find one. You can either distribute it (make sure to distribute .optdata and .sigdata as well). Or install the FSharp package.
But this is just guessing. For further insight you need to provide additional exception information (Stacktrace, the full message, inner exception ...).

My app is actually wpf app fully written in F#. FSharp.Core.dll is in app directory, it is 4.4.0 version. Maybe that is a problem, as your assembly and FSharp.Compiler.Service is older version?

In exception message I can see Output:
F# Interactive for F# 3.1

What assemblies should I include to the installation?

Here is full exception message:

FsiEvaluationException:

Error:

unknown(1,1): error FS1223: FSharp.Core.sigdata not found alongside FSharp.Core

unknown(1,1): error FS0229: Error opening binary file 'C:\Program Files (x86)\BeloSoft\Bfexplorer\FSharp.Core.dll': Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+StopProcessing' was thrown.

unknown(1,1): error FS3160: Problem reading assembly 'FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a': Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+StopProcessing' was thrown.

Output:
F# Interactive for F# 3.1 (private)
Freely distributed under the Apache 2.0 Open Source License

For help type #help;;

Input: Fsi Arguments: [|""C:\fsi.exe""; ""--noninteractive""|]

Exception: Yaaf.FSharp.Scripting.FsiEvaluationException: Error while creating a fsi session. ---> System.Exception: Error creating evaluation session: StopProcessing
""{Exception =
Error
((3160,
""Problem reading assembly 'FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a': Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+StopProcessing' was thrown.""),
unknown (1,0--1,80) IsSynthetic=false);
Phase = Interactive;}""
at Microsoft.FSharp.Compiler.Interactive.Shell.-ctor@2442-115.Invoke(String message)
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession..ctor(FsiEvaluationSessionHostConfig fsiConfig, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, Boolean fsiCollectible)
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.Create(FsiEvaluationSessionHostConfig fsiConfig, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, FSharpOption1 collectible) at Yaaf.FSharp.Scripting.Helper.fsiSession@929.Invoke(Unit unitVar0) at Yaaf.FSharp.Scripting.Helper.consoleCapture[a](TextWriter out, TextWriter err, FSharpFunc2 f)
at Yaaf.FSharp.Scripting.Helper.getSession(Object fsi, FsiOptions options, Boolean reportGlobal, FSharpOption1 liveOut, FSharpOption1 liveOutFsi, FSharpOption1 liveErr, FSharpOption1 liveErrFsi, Boolean preventStdOut)
--- End of inner exception stack trace ---
at Yaaf.FSharp.Scripting.Helper.getSession(Object fsi, FsiOptions options, Boolean reportGlobal, FSharpOption1 liveOut, FSharpOption1 liveOutFsi, FSharpOption1 liveErr, FSharpOption1 liveErrFsi, Boolean preventStdOut)
at BeloSoft.Bfexplorer.BotApplication.BfexplorerConsoleController.GetFsiSession()
at <StartupCode$Bfexplorer-BotUI>.$BfexplorerConsoleMvc.CompileAndEvaluate@120.Invoke(Unit unitVar)

I am sorry, you actually replied. Both .optdata and .sigdata should be included, now it all works, so fsi.exe is used or not?

In error message:

Input: Fsi Arguments: [|""C:\fsi.exe""; ""--noninteractive""|]

On my dev machine fsi.exe is included with VS, but it hardly be on users machines.

No fsi.exe is not used (the output is the same as from FSI, because FSharp.Compiler.Service shares the same code-base). So this can be closed?

Thanks for your help, it can be closed.

You are welcome!