Skip to content

Paket does not respect compatible versions of .Net Standard when adding references #4225

Open

Agent suggestions

Public preview

Description

@pastaav

Description

.Net Standard 1.X is possible to compile on later versions of .Net standard like .Net Standard 2.0, but Paket generate conditional loading of assemblys that mean that I on .Net Framework 4.7.2 does not get any assembly loaded at all.

An example would be that System.IO.Compression https://www.nuget.org/packages/System.IO.Compression/#supportedframeworks-body-tab is written for .Net Standard 1.3 and this imply compability with up to .Net Standard 2.1, but Paket give a Project file that ignore to load the assembly unless you explicity target the older versions.

The rules of .Net Standard can be found on https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0

Repro steps

Please provide the steps required to reproduce the problem

  1. Create a solution using .Net Framework 4.7.2

  2. Add reference to System.IO.Compression

  3. Write som code that depend on ZipArchive, but without the assembly loaded the code does not compile

Expected behavior

Paket should generate conditional assembly loading that respect .Net Standard compability guarantees so you can compile the code.

Actual behavior

You get a Project that must target lower version of the standard to compile

Known workarounds

If you manually add an assembly reference to the library, that is basically stop using Paket for Nuget paket, you can compile the code.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions