Skip to content

FSharp.Core 10.1.0.0 assembly mismatch when loading type providers compiled against SDK 10.0.200+ #1531

@dlidstrom

Description

@dlidstrom

Version

v7.31.1

Dotnet Info

.NET SDK:
Version: 10.0.202
Commit: 1e7d5a8ae3
Workload version: 10.0.202
MSBuild version: 18.3.3+1e7d5a8ae

Runtime Environment:
OS Name: Mac OS X
OS Version: 26.3
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/10.0.202/

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.

Host:
Version: 10.0.6
Architecture: arm64
Commit: 47fb725acf

.NET SDKs installed:
8.0.420 [/usr/local/share/dotnet/sdk]
10.0.102 [/usr/local/share/dotnet/sdk]
10.0.103 [/usr/local/share/dotnet/sdk]
10.0.200 [/usr/local/share/dotnet/sdk]
10.0.201 [/usr/local/share/dotnet/sdk]
10.0.202 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.26 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.26 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_CLI_TELEMETRY_OPTOUT [1]

global.json file:
/Users/daniel/programming/global.json

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Steps to reproduce

Type providers compiled against FSharp.Core 10.1.x fail with 'manifest definition does not match' on FSAutocomplete 7.31.1

This is an analysis conducted by Claude cli on my machine.

Environment

  • Ionide 7.31.1 / FSAutocomplete 7.31.1
  • .NET SDK: 10.0.202
  • SQLProvider 1.5.19
  • macOS (darwin)

Problem

Type providers compiled against FSharp.Core 10.1.0.0 (which ships with .NET SDK 10.0.200+)
fail to load at design time with:

Could not load file or assembly 'FSharp.Core, Version=10.1.0.0'
The located assembly's manifest definition does not match the assembly reference (0x80131040)

dotnet build succeeds; the error only appears in Ionide/VS Code.

Root Cause

FSAutocomplete 7.31.1 ships FSharp.Core.dll 10.0.0.0 in both its net8.0 and net9.0
bins:

~/.vscode/extensions/ionide.ionide-fsharp-7.31.1/bin/net8.0/FSharp.Core.dll -> 10.0.0.0
~/.vscode/extensions/ionide.ionide-fsharp-7.31.1/bin/net9.0/FSharp.Core.dll -> 10.0.0.0

SQLProvider 1.5.19's design-time DLL was compiled against FSharp.Core 10.1.0.0 (confirmed
via Assembly.GetReferencedAssemblies()):

FSharp.Data.SqlProvider.DesignTime.dll -> FSharp.Core ref: 10.1.0.0

The bundled FSharp.Core.dll in the package's typeproviders folder is also 10.1.0.0:

~/.nuget/packages/sqlprovider/1.5.19/typeproviders/fsharp41/net8.0/FSharp.Core.dll -> 10.1.0.0

When FSAutocomplete loads the type provider, the .NET runtime locates FSAutocomplete's own
FSharp.Core.dll (10.0.0.0) before the bundled one in the typeproviders/ folder. The
manifest version (10.0.0.0) doesn't satisfy the assembly reference (10.1.0.0) -> 0x80131040.

Steps to Reproduce

  1. Install .NET SDK 10.0.202 (FSharp.Core 10.1.x)
  2. Create an F# project (any TFM) with SQLProvider 1.5.19
  3. Open in VS Code with Ionide 7.31.1
  4. Observe the assembly load error in the F# output pane
dotnet --info
.NET SDK:
 Version:           10.0.202
 Commit:            1e7d5a8ae3
 Workload version:  10.0.202
 MSBuild version:   18.3.3+1e7d5a8ae

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  26.3
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/10.0.202/

Host:
  Version:      10.0.6
  Architecture: arm64
  Commit:       47fb725acf

.NET SDKs installed:
  8.0.420 [/usr/local/share/dotnet/sdk]
  10.0.102 [/usr/local/share/dotnet/sdk]
  10.0.103 [/usr/local/share/dotnet/sdk]
  10.0.200 [/usr/local/share/dotnet/sdk]
  10.0.201 [/usr/local/share/dotnet/sdk]
  10.0.202 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.26
  Microsoft.AspNetCore.App 10.0.3 – 10.0.6
  Microsoft.NETCore.App 8.0.26
  Microsoft.NETCore.App 10.0.3 – 10.0.6

Expected

Type providers compiled against FSharp.Core 10.1.x should load correctly.

Suggested Fix

Update FSAutocomplete's FSharp.Core dependency from 10.0.x to 10.1.x (the version that
ships with .NET SDK 10.0.200+). This affects any type provider released after SDK 10.0.200,
not just SQLProvider.

Workaround

Downgrade to an older SQLProvider version compiled against FSharp.Core 10.0.x, or pin the
.NET SDK to 10.0.1xx in global.json.

Details

Expect SQLProvider to work.

Logs

No response

Checklist

  • I have looked through existing issues to make sure that this bug has not been reported before
  • I have provided a descriptive title for this issue
  • I have made sure that that this bug is reproducible on the latest version of the package
  • I have provided all the information needed to reproduce this bug as efficiently as possible
  • I or my company would be willing to contribute this fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions