Skip to content

Regression: Cannot use two or more open sessions in FCS 43.7.200+ #16118

Closed

Description

@nightroman

Regression: Cannot use two or more open sessions in FCS 43.7.200+

Please find attached two projects, new (bad), old (good):
_231012_1018-43.7.200-regression.zip

Last good packages, see the project folder old_good
dotnet run works fine, it creates and invokes two sessions.

    <PackageReference Include="FSharp.Core" Version="7.0.0" />
    <PackageReference Include="FSharp.Compiler.Service" Version="42.7.101" />

Regression starts with these packages, see the project folder new_bad
dotnet run fails to invoke the second session.

    <PackageReference Include="FSharp.Core" Version="7.0.200" />
    <PackageReference Include="FSharp.Compiler.Service" Version="43.7.200" />

Error

[Loading C:\Users\roman.kuzmin\source\repos\FSCS\43.7.200-regression\new_bad\Test2\Test4.fsx]
System.TypeLoadException: Could not load type 'FSI_0001.Test3' from assembly 'FSI-ASSEMBLY, Version=0.0.0.32767, Culture=neutral, PublicKeyToken=null'.
   at <StartupCode$FSI_0002>.$FSI_0002_Test4$fsx.main@()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Stopped due to error

Known workarounds

Close all opened sessions before opening and invoking a new session.
(But in my case using 2+ open sessions is the design, not a mistake).

Related information

  • Operating system - Windows 10
  • .NET Runtime kind .NET Core 7
  • Editing Tools - Visual Studio 2022, 17.7.5

Activity

  1. added this to the Backlog milestone on Oct 12, 2023
  2. vzarytovskii commented on Oct 12, 2023

    @vzarytovskii
    Member

    @KevinRansom can you look into it? Sounds about related to the multiemit fix you did earlier

  3. KevinRansom commented on Oct 13, 2023

    @KevinRansom
    Contributor

    I am pretty sure that I know what caused it, and it should be relatively easily fixable. I believe it was caused by the change to using assembly versioning rather than assembly naming to enable fsi internals visibility.

  4. nightroman commented on Oct 18, 2023

    @nightroman
    ContributorAuthor

    When is the fix and updated package expected approximately?

  5. vzarytovskii commented on Oct 18, 2023

    @vzarytovskii
    Member

    When is the fix and updated package expected approximately?

    Probably together with 8.0.200, not entirely sure when it's going to be released. 8.0.100 is locked down, and it won't hit the fix bar for 7.0.xxx.

  6. KevinRansom commented on Oct 19, 2023

    @KevinRansom
    Contributor

    I have a fix, it is a depressingly tiny fix.

    The issue was assembly resolution under multi-emit fell back to simple name matching which is not super helpful when parts of the script exist in many different assemblies with the same simple name, varying only by version number.

    #16139

  7. psfinaki commented on Oct 20, 2023

    @psfinaki
    Contributor

    Closing as been fixed by the PR above.

  8. nightroman commented on Oct 25, 2023

    @nightroman
    ContributorAuthor

    @vzarytovskii @KevinRansom
    The PR with the fix was merged, great. But I have tried the just released FSharp.Compiler.Service 43.7.401 and the problem is still there. Is it how it should be?

  9. vzarytovskii commented on Oct 25, 2023

    @vzarytovskii
    Member

    @vzarytovskii @KevinRansom

    The PR with the fix was merged, great. But I have tried the just released FSharp.Compiler.Service 43.7.401 and the problem is still there. Is it how it should be?

    It was not backported to that version. Only to 43.8.xxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions