dotnet / dotnet/fsharp

Visual Studio selects the highest version of the sdk installed on the machine when executing scripts in FSI

Open
#17,307 6 comments 0 reactions 1 assignee Claimed by @KevinRansom View on GitHub
AI-thinks-windows-only Area-VS-FSI Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

This is incorrect behavior, it should select the version of the Sdk that shipped with the VS being executed.

![image](https://github.com/dotnet/fsharp/assets/5175830/000c9f23-08e8-4717-b639-b140627279fe)

Edited:
Okay, the current Fsi behaviour is this, if you start with send to interactive, it uses a global.son when present in the same directory as the script to figure out which Sdk to use.
If you specify nothing it does not use a global.json instead it selects the highest framework installed, which is slightly different to what the Sdk does, it selects the Sdk that was shipped with VS.

I propose changing the no global.json specified mechanism to use the version shipped with that VS. To change the specified VS add a script and include a global.json in the directory containing the script:

When you start an F# interactive session in VS you see this:
![image](https://github.com/dotnet/fsharp/assets/5175830/dc6fdab1-af18-4e60-ae31-f0f68609699c)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.