-
|
When using F# Interactive via FSharp.Compiler.Service 41.0.4 on Is there a way to make exceptions include line numbers when on net48 ? code used: let code = """
try
8 / 0 |> ignore
with e ->
printfn $"Runtime: {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}"
printfn $"Error: {e}"
"""
open System
open System.IO
open FSharp.Compiler.Interactive.Shell
let eval(codeStr) =
let inn = new StringReader("")
let out = Console.Out
let config = FsiEvaluationSession.GetDefaultConfiguration()
let noArgs = [| "the first arg is neded, but ignored"|]
let session = FsiEvaluationSession.Create(config, noArgs, inn, out, out)
session.EvalInteraction(codeStr)
eval(code)
System.Console.ReadLine() |> ignoreand <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net48;net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="6.0.4" />
<PackageReference Include="FSharp.Compiler.Service" Version="41.0.4" />
</ItemGroup>
</Project>full repo: https://github.com/goswinr/ErrorLineNumberMissing |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
|
You might try passing |
Beta Was this translation helpful? Give feedback.
-
|
You might also try |
Beta Was this translation helpful? Give feedback.
-
|
I'll convert this to a discussion since I don't think we'd treat this as a specific bug yet based on the info above |
Beta Was this translation helpful? Give feedback.
-
|
@dsyme I still have the problem when hosting a fsi session in a net48 process. Do you have any suggestions? Or can you suggest places to start looking for the issues in the source? |
Beta Was this translation helpful? Give feedback.
-
|
I am running FCS in net8 now, inside Rhino, that fixed it for me. |
Beta Was this translation helpful? Give feedback.


I am running FCS in net8 now, inside Rhino, that fixed it for me.