Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pastaav opened this issue Sep 8, 2023 · 0 comments

Comments

@pastaav
Copy link

pastaav commented Sep 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant