-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add progress report article about .NET 8 #956
Changes from 2 commits
3ea87d8
594b99f
2731c3b
4553ec4
80a3372
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: "Godot C# packages move to .NET 8" | ||
excerpt: "On moving to the latest .NET LTS release, and what it means for users." | ||
categories: ["progress-report"] | ||
author: Raul Santos | ||
image: /storage/blog/covers/progress-update-csharp-3.webp | ||
date: 2024-11-26 17:00:00 | ||
--- | ||
|
||
A new version of .NET is released every year on November, alternating Long Term Support (LTS) and Standard Term Support (STS) releases. The quality of all releases is the same. The only difference is the length of support. LTS releases are supported for 3 years, while STS releases are supported for 1 year and a half. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
With the release of Godot 4.0 we moved our C# packages from targeting Mono to .NET 6. This version of .NET was released on November 8, 2021 and ended support on November 12, 2024. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
With .NET 6 ending support, Godot C# packages in 4.4 will now target the next LTS release .NET 8. Thanks to [RedworkDE](https://github.com/RedworkDE) and [Paul Joannon](https://github.com/paulloz) for the great work in [GH-92131](https://github.com/godotengine/godot/pull/92131). | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<figure> | ||
<picture> | ||
<source srcset="/storage/blog/dotnet/release-schedule-dark.svg" media="(prefers-color-scheme: dark)"> | ||
<img class="lightbox-ignore" style="background-color: transparent;" src="/storage/blog/dotnet/release-schedule-light.svg"> | ||
</picture> | ||
<figcaption><small>.NET release cadence from the <a href="https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core">.NET official support policy</a>.</small></figcaption> | ||
</figure> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if the figure would look better in-between the paragraphs starting "A new version of .NET is released..." and "With the release of Godot 4.0..."? Doing so might make it clearer that the figure is about Microsoft's support policy for .NET, rather than Godot's. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have a strong preference for the location of the figure. It felt a bit weird to me to separate small paragraphs with a big image, so that's why I put it at the end of the section. |
||
## What does this mean for users? | ||
|
||
This means your project now needs to target .NET 8 or newer, otherwise it will be incompatible with the new `GodotSharp` packages. But you can still use libraries that target older .NET versions. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Existing projects will be automatically upgraded to target `net8.0` when they are opened with Godot 4.4. If your project already targets .NET 8 or newer, nothing will change. Thanks to [Andreia Gaita](https://github.com/shana) for implementing this in [GH-82927](https://github.com/godotengine/godot/pull/82927). | ||
|
||
## What took so long? | ||
|
||
The version of .NET that a library targets becomes the minimum required version for consumers of that library. That is, if the `GodotSharp` package targets `net7.0`, your game project needs to target `net7.0` or newer. We didn't want to force our users to upgrade to a non-LTS release. | ||
|
||
When .NET 8 was released, it would've been a good time to bump the target version in Godot C# packages, since .NET 8 is an LTS release. Unfortunately, there were some breaking changes in .NET 7[^1] that prevented us from upgrading and making the required changes took us longer than we hoped. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
However, users could always use the latest version of .NET in their projects. Up until now, .NET 6 has been the minimum required version, but newer versions have always been supported from day one (even the pre-releases[^2]). In 4.4, the new minimum is now .NET 8, but as always, your projects can target the recent STS release .NET 9 and any newer version that is released in the future. | ||
|
||
Libraries tend to stay on older versions of .NET to support as many consumers as possible. But upgrading to the latest version of .NET brings benefits that we want to take advantage of. | ||
|
||
[^1]: .NET 7 introduced the new `scoped` keyword. This feature breaks compatibility in some low-level scenarios that affected Godot. | ||
|
||
[^2]: While pre-releases are usually supported by Godot, they may require users to enable them by setting the `DOTNET_ROLL_FORWARD_TO_PRERELEASE` environment variable to `1`. Keep in mind pre-releases are still a work-in-progress so there may be bugs. | ||
|
||
## What about older Godot releases? | ||
|
||
We encourage users to upgrade to the latest version of Godot. We work hard to prevent breaking compatibility, to ensure you can safely upgrade to the next version of Godot when it's released. Please, make sure to test the pre-releases and let us know if you find some bugs so we can fix them before the stable release. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Older versions of Godot will keep targeting .NET 6, we won't change the target version in patch updates, since that would be a big breaking change. So if you still need to target .NET 6 you can stay on an older version of Godot, but we strongly encourage you to update to benefit from all the fixes and improvements included in the latest version of Godot and the .NET runtime. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## What about future .NET releases? | ||
|
||
Godot always supports the latest .NET version. The version targeted by Godot's C# packages is only the minimum version that your project can target, but you are always free to target a newer .NET version. To target the latest .NET 9 release in your project, you just need to install the latest version of the .NET SDK and change the `TargetFramework` property in your `.csproj`: | ||
|
||
```xml | ||
<Project Sdk="Godot.NET.Sdk/4.3.0"> | ||
<PropertyGroup> | ||
<!-- Target .NET 9 --> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<EnableDynamicLoading>true</EnableDynamicLoading> | ||
</PropertyGroup> | ||
</Project> | ||
``` | ||
|
||
<div class="card card-warning"> | ||
<p>You should always use the latest version of the .NET SDK even when targeting an older .NET version in your projects.</p> | ||
</div> | ||
|
||
We'll keep updating our C# packages to the latest LTS release as they are released. The next LTS release will be .NET 10 which will be released on November 2025. | ||
raulsntos marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Add cover image. This webp doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like this work?
Also, for this one I would like us to try with a jpg, trying to make sure the reason why our images don't show in Bluesky is not because of webp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If WebP is problematic, note that some hosts will happily display WebP files that have their extension renamed to
.png
(such as GitHub).