Git Product home page Git Product logo

Comments (3)

John0King avatar John0King commented on July 18, 2024

Well, I think this is the correct behavior, since .NET Standard 2.1 is higher than .NET Standard 2.0 , and .Net Core 3.1 can use .NET Standard 2.1,
this is because .NET Standard 2.1 has much more api than .NET Standard 2.0 (the Span<T> and more) so library that target .NET Standard 2.1 can more optimization (for example , use Span<T> related type and api)

from standard.

rexcfnghk avatar rexcfnghk commented on July 18, 2024

Well, I think this is the correct behavior, since .NET Standard 2.1 is higher than .NET Standard 2.0 , and .Net Core 3.1 can use .NET Standard 2.1,
this is because .NET Standard 2.1 has much more api than .NET Standard 2.0 (the Span<T> and more) so library that target .NET Standard 2.1 can more optimization (for example , use Span<T> related type and api)

But from the project dependency hierarchy, it should be clear that ClassProject1 targets .NET Standard 2.0 only so shouldn't ClassProject2 be more restrictive by targeting .NET Standard 2.0 instead of 2.1?

from standard.

terrajobst avatar terrajobst commented on July 18, 2024

A method (ClassProject2Test1) on ClassProject2 is hidden behind a #if NETSTANDARD2_0 preprocessor directive.

This is a violation of normal versioning rules. If you multitarget for A and B (and B > A) than B must not have fewer APIs than A. Replace .NET Standard with .NET Core and then it should be easy to understand:

  • TestProject1 targeting netcoreapp3.0
  • ClassProject1 targeting netcoreapp2.0
  • ClassProject2 targeting both netcoreapp2.0 and netcoreapp3.0

The application (TestProject1) will run on .NET Core 3.0. That means it will use the netcoreapp2.0 build of ClassProject1 (because it's the only option) and the netcoreapp3.0 of ClassProject2 (because it's the better match).

Does this make sense?

Closing as by-design.

from standard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.