Skip to content

Paket does not overwrite Framework References (ex.: System.IO.Compression) #2811

Closed as not planned

Description

@0x53A
  1. Create a new C# net461 project and add a reference to the fw-assembly System.IO.Compression
  2. Convert this project to paket and add the nuget System.IO.Compression

Expected: the FW reference is removed and a reference to the nuget is added
Actual: the FW reference is NOT removed, and a reference to the nuget is NOT added.

Workaround:

I can manually remove <Reference Include="System.IO.Compression" /> from the project file (or same via gui).
If I then rerun paket install, it adds the reference to the nuget.

Repro: 0x53A/Paket_SystemIOCompression@2175ad7

Activity

  1. matthid commented on Oct 2, 2017

    @matthid
    Member

    I'm not even sure this is a bug, we do not touch user entries by design.

  2. 0x53A commented on Oct 2, 2017

    @0x53A
    ContributorAuthor

    Nuget does remove the FW reference and adds the reference into the packages dir if you install the package.

    And I'm pretty sure I have seen paket remove the default reference to FSharp.Core when you add the nuget package?

  3. forki commented on Oct 2, 2017

    @forki
    Member

    yes we did that and had the -hard switch for exactly that. And while removing the switch I set all locations to true. So I assume it should actually replace the reference

  4. 0x53A commented on Mar 10, 2018

    @0x53A
    ContributorAuthor

    Just hit this again, this time with an FSharp.Core.

    The issue is two-fold:

    1. the old references are not removed
    2. the new references are not added!

    And the worst part is that, at the moment, the failure is silent and only manifests at runtime with an assembly mismatch.

    I propose, as a quick fix, to solve #2. On the next compile, the user will get a warning like this and can then remove the pre-existing reference themselves.

    1>C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3243: No way to resolve conflict between "System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". Choosing "System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
    1>  Consider app.config remapping of assembly "System.IO.Compression, Culture=neutral, PublicKeyToken=b77a5c561934e089" from Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.IO.Compression.dll] to Version "4.1.2.0" [C:\Users\lr\Source\Repos\Paket_SystemIOCompression\packages\System.IO.Compression\lib\net46\System.IO.Compression.dll] to solve conflict and get rid of warning.
    1>  Paket_SystemIOCompression -> C:\Users\lr\Source\Repos\Paket_SystemIOCompression\Paket_SystemIOCompression\bin\Debug\Paket_SystemIOCompression.exe
    

    What do you think?

  5. added a commit that references this issue on Mar 10, 2018
  6. 0x53A commented on Mar 10, 2018

    @0x53A
    ContributorAuthor

    --hard was removed with 24e08ed (3.0.0-alpha098).

    I have tested that 2.58.3.0 has the same behavior, so it is not a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions