dotnet / dotnet/fsharp

Issue with consuming DLLs built with .NET7 from .NET6

Open
#14,313 4 comments 0 reactions 0 assignees View on GitHub
Informational
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

1. Build a library which has langversion=7 and targets net6.0, using net7.0 SDK
1. Library should involve some sort of SRTP code (with either new or old syntax).
3. Reference this library in a project which targets net6.0 and uses net6.0 SDK

This will result in `Error reading/writing metadata for the F# compiled DLL '%s'. Was the DLL compiled with an earlier version of the F# compiler? (error: 'u_trait_sln').`.

This is sort of by design, since we're technically picking some data which is unknown to the old compiler.

The general recommendation is to move to .NET7 SDK on the consumer side, or target .NET7, when langversion 7 is needed to be used.

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.