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

Switch from .NET Core 3.1 to .NET 5 #912

Closed
bmello4688 opened this issue Nov 16, 2020 · 9 comments
Closed

Switch from .NET Core 3.1 to .NET 5 #912

bmello4688 opened this issue Nov 16, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request priority-high High priority needs to be fixed or done in release work-estimate-L 2-7 Days of work. Should try to break down into smaller issues

Comments

@bmello4688
Copy link

As a developer and user, I would like to move all projects to .Net 5 so that their is less maintenance and bugs supporting multiple development frameworks.

Discussion Items:
Will need some minor changes for MSBuild, such as WPF projects.
All users of stride will have to use .Net 5 not core or framework
Removing any code related to choosing framework or core

@bmello4688 bmello4688 added the enhancement New feature or request label Nov 16, 2020
@xen2
Copy link
Member

xen2 commented Nov 16, 2020

Current plan & latest discussions on this:

  • We should probably skip .NET Core 3.1 and release .NET 5 directly to avoid the extra framework to support (& associated user project ugprades)
  • Current idea was to have both .NET Core and .NET Framework only for a single version (4.0 or 4.1), making it easier for users to upgrade (i.e. user can test back and forth the same project without upgrade and without any other engine feature/behavior change). Then the next version (4.1 or 4.2) would drop .NET Framework.
    However that's something we could rediscuss.

@manio143
Copy link
Member

If possible, could we setup the upgrade such that if someone needs to stay on .NET Core they could still do so by just compiling Stride themselves for another target? In other words, can we isolate breaking changes and possibly use if directives before completely dropping .NET Core reliant code in the next release.

@Perksey
Copy link

Perksey commented Nov 16, 2020

I suppose one thing I didn't think about is that .NET Core 3.1 is an LTS, whereas 5 is not. I don't know what Stride's support policy is, but unless the .NET 6 version comes out a few months after .NET 5 comes out, users may be forced to use an unsupported TFM. Same goes if the .NET 6 version of Stride has breaking changes which may defer an upgrade.

@tebjan
Copy link
Member

tebjan commented Nov 16, 2020

We are in favor of the two steps strategy with fw and 5 support. Otherwise our fork would be hard to manage and makes pull requests harder. A transition period for existing projects is quite important for us, since upgrading will take us a few months of work.

@Zeroto
Copy link
Contributor

Zeroto commented Nov 16, 2020

I suppose one thing I didn't think about is that .NET Core 3.1 is an LTS, whereas 5 is not. I don't know what Stride's support policy is, but unless the .NET 6 version comes out a few months after .NET 5 comes out, users may be forced to use an unsupported TFM. Same goes if the .NET 6 version of Stride has breaking changes which may defer an upgrade.

The scheduled release date for .NET 6 is november 2021. So a year after .NET 5. .NET 5 support will end 3 months after the .NET 6 release.

@xen2
Copy link
Member

xen2 commented Nov 16, 2020

BTW, here is some work I started on .NET 5 a few days ago: https://github.com/xen2/stride/tree/net5
Sadly I will have to put this aside for a few days (until I finish relocation).

@ericwj
Copy link
Collaborator

ericwj commented Nov 17, 2020

Risking saying what you already know but:

  • Please align with this as far as at all possible, and with how Visual Studio works when multi-targeting: Target Framework Names in .NET 5. I think at least some of the MSBuild Extra's SDK foo is no longer needed and the more Stride is just standard .NET the better imho.
  • .NET 5 is more compatible with .NET 3.1 than with .NET Framework.
  • It is most likely almost effortless to not change much and go to .NET 5 and keep supporting both .NET Framework and .NET 3.1.
    • Almost nothing that is already written will change.
    • Most improvements and new code can be #if'deffed if at all needed.
    • Build steps might need work, but some won't be needed with .NET 5 I expect and they can be conditionally included during build, too. Based on TFM.
  • For most people, imho especially games, staying on an LTS is pointless, because there will be monthly updates anyway, which you have to deploy to be 'in support', but if anyone has compelling reasons to stay on 3.1 or .NET Framework then that shouldn't be hard until the codebase actually diverges.

I do feel that the stride preprocessor defines are overlapping with those being defined in .NET5. Following the work to make Stride compile and work correctly on .NET 5, I suggest removing all preprocessor defines in favour of those defined by .NET 5, looking into aligning those used for older TFM's with those defined in .NET 5 and to prefer runtime checks for the graphics API rather than preprocessor defines.

Finally I think it would be easy to adopt new targets, seeing how they now all use the same SDK and merely require some MSBuild properties to get set, and I would be very interested to see the project reunion type projects (WinUI on Desktop) become a new target that Stride supports. And MAUI, off course, when that will be usable - in favor of Stride's custom UI framework, at the very least to be able to use that, too.

@bmello4688 bmello4688 added priority-high High priority needs to be fixed or done in release work-estimate-L 2-7 Days of work. Should try to break down into smaller issues labels Nov 19, 2020
@xen2 xen2 self-assigned this Nov 24, 2020
@xen2 xen2 changed the title Migrate to .Net 5 removing explicit support for Core and Framework Switch from .NET Core 3.1 to .NET 5 Nov 25, 2020
xen2 added a commit to xen2/stride that referenced this issue Nov 25, 2020
@xen2
Copy link
Member

xen2 commented Nov 25, 2020

I think I am mostly done with the prototype. Feel free to try it (from https://github.com/xen2/stride/tree/net5).

@ericwj thanks for the feedbacks.
I would also like to be able to get rid of MSBuild.Sdk.Extras and get back to a more standard building process.
It seems the two main blockers for that are:

  • Switch to .NET 5.0 only (which should happen in 4.1) so that we don't need RuntimeIdentifiers for .NET Standard anymore
    This should remove all our complex steps related to RuntimeIdentifiers (we might need to unify some code between platforms before)
  • Either wait for net6.0-android and net6.0-ios, or wait for Support additional target frameworks such as for Xamarin, UWP, etc dotnet/sdk#491 to be fixed, or embed the small part of MSBuild.Sdk.Extras to deal with that

In general, a lot of custom build steps & workaround are probably not necessary anymore and/or can be done in a nicer way.

@Perksey
Copy link

Perksey commented Nov 25, 2020 via email

xen2 added a commit to xen2/stride that referenced this issue Dec 1, 2020
@xen2 xen2 mentioned this issue Dec 1, 2020
7 tasks
xen2 added a commit to xen2/stride that referenced this issue Dec 2, 2020
xen2 added a commit to xen2/stride that referenced this issue Dec 2, 2020
@xen2 xen2 closed this as completed in 6f8a265 Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high High priority needs to be fixed or done in release work-estimate-L 2-7 Days of work. Should try to break down into smaller issues
Projects
None yet
Development

No branches or pull requests

7 participants