Skip to content

FSharp.Compiler.Interactive.Settings seemingly not part of script references #7950

@baronfel

Description

@baronfel

@kevmal on the F# foundation slack shared an image of a typecheck error he had in a fsx script. He's on 2019 16.4, and after looking at the DotNetFrameworkDependencies.fs file I think I see what the problem is.

image (1)

I believe the issue comes from here, where the string "FSharp.Compiler.Interactive.Settings" is passed as one of the dependencies to be resolved by getDependenciesOf. getDependenciesOf has some handling for 'simple names', that is assembly names that are not full file paths: it prepends the framework directory to the simple name and attempts to resolve that reference.

In this case I think this logic is incorrect, because the "FSharp.Compiler.Interactive.Settings" reference is colocated with the compiler, not with the rest of the framework references. I think that in this case, the assembly should be manually resolved by joining the simple name with the already-defined getFSharpCompilerLocation path, which should be correct.

Repro steps

  1. Create an fsx script in VS 2019 16.4
  2. use any member of the fsi binding.

Expected behavior

The fsi binding's members are available in-editor.

Actual behavior

The fsi binding's members are not available.

Known workarounds

The user can always provide an explicit #r reference to the dll, but this is non-portable.

Related information

Provide any related information (optional):

  • Operating system: Windows
  • .NET Runtime kind: .NET Core 3.x
  • Editing Tools: Visual Studio 2019 16.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions