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
C#: Allow use of .NET 7 #71825
Merged
Merged
C#: Allow use of .NET 7 #71825
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Have you tried using
Major
instead? AFAIK that should prefer the .NET 6 SDK when both are installed and may be safer than using a newer major version that may include breaking changes.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.
Yes, but that means you can't use projects targeting .net7 in the editor if both .net6 and .net7 are installed on a machine, but after uninstalling .net6 it will then work, which is IMO really unintuitive.
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.
🤔 Oh yeah you are right, I agree it's unintuitive.
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.
We talked about this the other day. The problem with
Major
is that (assuming both net6 and net7 are installed) ifGodotPlugins
targets net6, then that's what the Godot editor will load. If that happens, there will be problems if a game project targets net7, because only one runtime can be loaded.As such, we decided
LatestMajor
was the way to go. The only drawback here is the risk of a future .NET version breaking backwards compatibility. I think this is a risk we will have to live with, but it would be great if we can have a workaround for users in case that ever happens. My idea was to add a project/editor setting to useMajor
if desired.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.
The question really is how long term .NET 6 support is supposed to be. If the plan is to fully switch to .NET 7 as soon as all the kinks are worked out, I would just not bother with being able to use 6 over 7, when both are installed. If on the other hand .NET 6 is going to remain supported for the full 4.0 release, I would load the framework based on the runtime config of the user project and only fall back to the runtime config of GodotPlugins, if the project was not built yet / the desired target framework is not installed.