fsprojects / fsprojects/Paket

Duplicated library references in 5.151.1

Open
#3,117 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

After patching Paket to 5.151.1 (from 5.150.0) resolution behavior changed for some reason for package System.Net.Http - it is now referenced through Paket, even though it should not be.

Repro steps
  1. Create .Net Framework 4.6 project.

  2. (potentially optional) Make sure, that System.Net.Http is in packet.lock file (as a depedency to something else, for example .NetStandard 2.0. Make sure that System.Net.Http is NOT inside paket.dependencies or paket.reference

  3. Reference System.Net.Http through assemblies project reference (reference .net framework library version 4.0.0).

  4. run paket.exe install

Expected behavior

Only 1 reference, through <Reference Include="System.Net.Http" /> should be present in *.csproj file - this basically references System.Net.Http 4.0.0 from .Net Framework.

Actual behavior

Reference in expected behavior exists, however, additional one is added from packages in form of:

<Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6'">
      <ItemGroup>
        <Reference Include="System.Net.Http">
          <HintPath>..\packages\System.Net.Http\lib\net46\System.Net.Http.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

References version is slightly newer, so compilation fails because 2 libraries with same types are references.

Known workarounds

Downgrade to packet version 5.150.0.

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

Reproduce the issue with the .NET Framework 4.6 project, the relevant entry in packet.lock, and the existing System.Net.Http project reference, then run paket.exe install. Inspect the generated *.csproj and confirm whether both the framework reference and a Paket reference are present; done means only the expected framework reference remains.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.