Skip to content

FSharp.Compiler.Service v38.0 fails with the official sample in net472 #10467

Closed
@nightroman

Description

@nightroman

The sample code is from http://fsharp.github.io/FSharp.Compiler.Service/interactive.html

It works in net50 and fails in net472.

Steps:

  • use the attached project

  • change to the project directory and run

dotnet run

Actual result

It fails with this not clear error:

Unhandled Exception: System.Exception: Error creating evaluation session: StopProcessingExn None
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1433.Invoke(String message) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1433
   at FSharp.Compiler.Interactive.Shell.FsiEvaluationSession..ctor(FsiEvaluationSessionHostConfig fsi, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, Boolean fsiCollectible, FSharpOption`1 legacyReferenceResolver) in F:\workspace\_work\1\s\src\fsharp\fsi\fsi.fs:line 2829
   at FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.Create(FsiEvaluationSessionHostConfig fsiConfig, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, FSharpOption`1 collectible, FSharpOption`1 legacyReferenceResolver) in F:\workspace\_work\1\s\src\fsharp\fsi\fsi.fs:line 3155
   at Program.main(String[] argv) in C:\Users\rjq\Desktop\FCS_net472\Program.fs:line 20

Expected result

It works and prints "43".

Related question/issue

Is FCS v38.0 supposed to work in net472? I thought so but maybe I missed something fundamental.

If it is supposed to work, I have another issue from the actual app with a clear error on creating a session:

error FS0078: Unable to find the file 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Workflow.Compiler.exe.dll' in any of� C:\Windows\Microsoft.NET\Framework64\v4.0.30319� C:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF� C:\Bin\Far\x64� C:\Bin\Far\x64\

Known workarounds

For the sample, like I said, using net50 works around the issue.

But for the actual app, none. It cannot yet use net50 for many reasons.

I hope the underlying problem is the same, so if it is solved for the sample, the app might work as well.


FCS_net472.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions