Skip to content

FSharp.Core "redirects: force" warning for projects that target net5.0 and later #4455

Closed

Description

@nojaf

Description

With Paket 12.0.0-alpha001, paket install warns about every F# project that targets .NET 5 or later:

F# project .../FsAutoComplete.Logging.fsproj references FSharp.Core without specifying "redirects: force" in paket.dependencies. This can lead to "Could not load file or assembly 'FSharp.Core'" errors at runtime. See https://fsprojects.github.io/Paket/dependencies-file.html#redirects-settings for details.

We try Paket 12.0.0-alpha001 in FsAutoComplete. None of its projects target the .NET Framework (they target net8.0, net9.0 and net10.0), and Paket 10.3.1 printed no warning. Binding redirects do not apply to these projects, so the warning is a false positive.

Cause

shouldWarnAboutFSharpCoreRedirects treats every FrameworkIdentifier.DotNetFramework _ as the .NET Framework. Paket also models .NET 5 and later as DotNetFramework V5 to V10, so a net8.0 project matches. Paket.Core 12.0.0-alpha001 returns this for the projects above:

#r "nuget: Paket.Core, 12.0.0-alpha001"
open Paket
let p = ProjectFile.LoadFromFile "src/FsAutoComplete.Logging/FsAutoComplete.Logging.fsproj" // <TargetFramework>net8.0</TargetFramework>
p.GetTargetProfiles()
// [{ RawTargetProfile = SinglePlatformP (DotNetFramework V8); CompareString = "net8.0" }]

Repro

  1. An SDK-style .fsproj with <TargetFramework>net8.0</TargetFramework> that references FSharp.Core through Paket, without redirects: force.
  2. dotnet paket install with 12.0.0-alpha001.
  3. The warning appears for that project.

Suggested fix

Count only DotNetFramework versions below V5 as the .NET Framework, and add a net8.0 profile to the unit tests of shouldWarnAboutFSharpCoreRedirects.

Activity

  1. added a commit that references this issue on Oct 13, 2026
  2. nojaf commented on Oct 13, 2026

    @nojaf
    Author

    /repo-assist go for it!

  3. added
    needs investigation
    on Oct 14, 2026
  4. github-actions commented on Oct 16, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Thanks for the precise diagnosis, @nojaf. I opened a draft PR that stops counting DotNetFramework V5–V11 as the .NET Framework in shouldWarnAboutFSharpCoreRedirects, with net8.0 unit tests. It couldn't be built in my sandbox, so CI will be the first real check.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.
    Comment /repo-assist to run again

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@b4e175bab6674279e0fe158f7dc877b77bc9d92f
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds investigation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions