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

Support .NET 9 #3007

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Support .NET 9 #3007

wants to merge 14 commits into from

Conversation

martincostello
Copy link
Collaborator

@martincostello martincostello commented Aug 1, 2024

Add support for .NET 9 and drop support for out-of-support versions of .NET.

Changes:

Will remain in draft until November 2024 when .NET 9 is officially released, with the intention to release soon afterwards

@martincostello martincostello added dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code version-major A change suitable for release in a major version labels Aug 1, 2024
@martincostello martincostello added this to the v7.0.0 milestone Aug 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.98%. Comparing base (6995d8a) to head (55ff025).
Report is 3 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3007      +/-   ##
==========================================
- Coverage   91.43%   81.98%   -9.46%     
==========================================
  Files          76       76              
  Lines        3119     3119              
  Branches      519      519              
==========================================
- Hits         2852     2557     -295     
- Misses        267      562     +295     
Flag Coverage Δ
Linux 81.98% <100.00%> (-9.46%) ⬇️
Windows 81.98% <100.00%> (-9.46%) ⬇️
macOS 81.98% <100.00%> (-9.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@bkoelman bkoelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to see preparations being made for .NET 9. I've shared some comments based on my own experience, that may be of help.

.github/workflows/build.yml Show resolved Hide resolved
Directory.Build.props Show resolved Hide resolved
martincostello and others added 10 commits October 15, 2024 11:59
- Add `net9.0` TFMs.
- Drop TFMs for all out-of-support versions of .NET.
- Bump version to `7.0.0`.
- Only audit direct NuGet dependencies.
- Suppress vulnerabilities in IdentityServer4 used in sample.
- Remove some now-redundant pre-processor directives.
Target .NET 9 versions for Microsoft.AspNetCore.OpenApi in test sites.
Bump Microsoft.OpenApi to the latest version.
* Update .NET SDK

Update .NET SDK to version 9.0.100-preview.7.24407.12.

---
updated-dependencies:
- dependency-name: Microsoft.NET.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update NuGet packages
Bump NuGet packages for .NET 9 preview 7.

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Costello <[email protected]>
Bump Microsoft.OpenApi to 1.6.18.
Bump Microsoft.OpenApi to 1.6.20.
Update Microsoft.OpenApi to 1.6.21.
* Update .NET SDK

Update .NET SDK to version 9.0.100-rc.1.24452.12.

---
updated-dependencies:
- dependency-name: Microsoft.NET.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update NuGet packages
Update NuGet packages for RC1.

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Costello <[email protected]>
Make all the middleware classes internal as they have no useful public-facing functionality (e.g. virtual members).

Resolves #2805.
* Update .NET SDK

Update .NET SDK to version 9.0.100-rc.2.24474.11.

---
updated-dependencies:
- dependency-name: Microsoft.NET.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update NuGet packages
Update NuGet packages for .NET 9 RC2.

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Costello <[email protected]>
Bump Microsoft.OpenApi to 1.6.22.
Update packages for ASP.NET Core 8.0.10.
Put the newest first so Visual Studio loads the latest version as the selected TFM by default.
- Remove redundant comment.
- Add link to tracking issue in comment.
@martincostello
Copy link
Collaborator Author

@mesMess Could I get a review/approval on this PR ahead-of-time please? I'd like to be able to merge this and ship a release on 12th November once the stable 9.0.0 packages are in NuGet.org.

@jgarciadelanoceda
Copy link
Contributor

@martincostello the dotnet6 release is going to be out of release the same day that dotnet9 comes, why not deleting also dotnet6?
Also if the nugget of STJ is greater than 8 we can delete a lot of compiled primitives that are present in #2988 have you considered it?

@martincostello
Copy link
Collaborator Author

martincostello commented Oct 17, 2024

It was considered (see original issue) but I decided against it to not generate a cliff on day 1 of support ending. 6 will be removed in a future release.

Keeping the package versions in line with the TFMs keeps things in configurations that the .NET team explicitly test for, makes things easier to reason about to support, and means assemblies that ship with the shared framework able to be referenced in the deployed application. Making a .NET 8 app use .NET 9 assemblies bloats the deployed application as it has to include a copy of the newer assemblies. You can see Aspire 9 does this for example for its net8.0 and net9.0 targets.

@jgarciadelanoceda
Copy link
Contributor

jgarciadelanoceda commented Oct 17, 2024

Yeah I was thinking of .net standard and also framework only, because( I do not know if many are using), but it can give the users of that platforms the ability of using the new STJ attributes.
Just sifting the reference of the nugget to a recent one ( it was lower than 5).
The compile directive has to change in order to support this to net>7 or net standard.. hopefully that works

@martincostello
Copy link
Collaborator Author

Maybe, but sometimes libraries have some features that only light up in newer runtimes due to language features needed, or new APIs or overloads of them. Trying to run a .NET 6 app with a 9 package won't have been tested for, and won't necessarily be able to use any improvements (or worse, fall back to netstandard2.0 and then lose even 5.0 or 6.0 specific features).

Ultimately, it's not worth the complexity/burden to us in terms of support, over just using 6 with 6, 8 with 8 etc.

If people want new features, they can upgrade their apps to the version that introduces them.

@mesMess
Copy link
Collaborator

mesMess commented Oct 17, 2024

@mesMess Could I get a review/approval on this PR ahead-of-time please? I'd like to be able to merge this and ship a release on 12th November once the stable 9.0.0 packages are in NuGet.org.

Yep, I'll do that today.

Copy link
Collaborator

@mesMess mesMess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build bump 7 -> 8 (next LTS)
Microsoft OenApi version bump
Bump to the RC for .NET 9
Moving some object to internal from public
Some of the shipped/un-shipped files are empty
Sealing some internal classes (UI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code version-major A change suitable for release in a major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider making more types internal Drop support for out-of-support .NET versions
5 participants