fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

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

Open KevinRansom opened this issue 1 year ago • 5 comments

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

image

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

KevinRansom avatar Jun 14 '24 06:06 KevinRansom

That's debatable - any global.json the user may have would also influence SDK selection and therefore the FSI chosen.

baronfel avatar Jun 14 '24 12:06 baronfel

That's debatable - any global.json the user may have would also influence SDK selection and therefore the FSI chosen.

This. It should take global json into account. Like it does for building.

vzarytovskii avatar Jun 14 '24 13:06 vzarytovskii

@baronfel , @vzarytovskii --- so are you suggesting that what we do now is correct? or perhaps that the actual final implementation requires a more rigourous analysis than is currently described above?

And could you point me to the description of Visual Studios actual behavior so that I can modify the description above.

Thanks

Kevin

KevinRansom avatar Jun 14 '24 19:06 KevinRansom

image

KevinRansom avatar Jun 14 '24 19:06 KevinRansom

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

KevinRansom avatar Jun 14 '24 20:06 KevinRansom

I think this is the same issue as https://github.com/dotnet/fsharp/issues/15492

TheAngryByrd avatar Apr 08 '25 21:04 TheAngryByrd