fsprojects / fsprojects/Paket

Wrong versions added for System.* redirects

Open
#3,515 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs triage
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

When referencing Microsoft.CodeAnalysis.CSharp, assembly bindings get created for System.* with the wrong version.

Repro steps

Create a .NET 4.7.1 console or web application, convert to Paket. Use this as dependencies:

source https://api.nuget.org/v3/index.json
framework: net471
nuget Microsoft.CodeAnalysis.CSharp

This as references:

Microsoft.CodeAnalysis.CSharp

Run paket install --redirects

Expected behavior

app.config does not have redirects that are breaking at runtime.

Actual behavior

Among others, System.IO.Compression is redirected to version 4.1.2.0 (latest on nuget) while the project actually uses an installed version 4.2.0.0.

Known workarounds

Disable generating these redirects in paket.dependencies:

System.IO.Compression redirects: off
System.Xml.XPath.XDocument redirects: off
System.Linq redirects: off
System.Linq.Expressions redirects: off
System.Security.Cryptography.Algorithms redirects: off
System.Runtime redirects: off
System.Runtime.Extensions redirects: off
System.Runtime.InteropServices redirects: off
System.Security.Cryptography.Primitives redirects: off
System.Threading.Thread redirects: off

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the paket install --redirects command with the stated net471 dependencies and inspect the generated app.config. Trace how Paket selects versions for the listed System.* redirects. Done means redirects reference the versions actually used by the project and no longer break at runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, fsharp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.