Git Product home page Git Product logo

Comments (5)

abatishchev avatar abatishchev commented on June 5, 2024

hi @andreijw,

here's the code:

<When Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net6.0'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);MODERN_DOTNET</DefineConstants>
</PropertyGroup>
</When>

What means that MODERN_DOTNET is enabled on the following platforms:

  • net462
  • netstandard2.0
  • net6.0

And here's the list of all platforms the library supports:

<TargetFrameworks>netstandard1.3;netstandard2.0;net6.0;net35;net40;net462;</TargetFrameworks>

from jwt.

abatishchev avatar abatishchev commented on June 5, 2024

If your project targets net8.0 and references JWT, it'll automatically references the net6.0 version which includes all the latestr features.

from jwt.

abatishchev avatar abatishchev commented on June 5, 2024

See also the discussion for .NET 7.0: #451

from jwt.

andreijw avatar andreijw commented on June 5, 2024

Thanks a lot @abatishchev, this was very helpful.
My next question now, is using the dotnet 8.0 AOT features I have come into a lot of serialization issues. I found a way around it, but it requires adding a Parameterless constructor annotated as a JsonConstructor using System.Text.Json

An example would be in the JWT/Builder/JwtHeader.cs :

#if MODERN_DOTNET 
        [System.Text.Json.Serialization.JsonConstructor] 
#endif 
        public JwtHeader() { }

I propose making a PR to add this in order to accommodate anyone using AOT.

from jwt.

abatishchev avatar abatishchev commented on June 5, 2024

Sure thing, a contribution is very welcome!

Can you please close this issue (as it was mostly about .NET 8), open a new one (for the AOT/serialization issues), and then submit a PR which would reference/resolve the new issue.

from jwt.

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.