Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Support .NET 5 on Xamarin.Forms 5.x #12112

Closed
YZahringer opened this issue Sep 14, 2020 · 10 comments
Closed

[Enhancement] Support .NET 5 on Xamarin.Forms 5.x #12112

YZahringer opened this issue Sep 14, 2020 · 10 comments

Comments

@YZahringer
Copy link
Contributor

YZahringer commented Sep 14, 2020

Summary

As Xamarin.Forms 5.0 is the latest major version until .NET MAUI, it would be very useful to target .NET 5.

.NET 5 is still in Release Candidate, but it is planned to target it in Xamarin.Forms when it's released? Or we will have to wait for .NET MAUI and .NET 6?

API Changes

Target new net5.0* framework.

Intended Use Case

Use libs that targets .NET 5 with Xamarin.Forms.

@davidortinau
Copy link
Contributor

@YZahringer I hear you. This is unlikely to happen, and that's a good thing. By targeting .NET 6 we can:

  • continue shipping Xamarin.Forms at the current cadence of every 6 weeks
  • continue shipping Android and iOS SDK updates in a timely fashion (imagine shipping iOS 14 for 2 different versions of .NET, double the work, yikes!)
  • allow the .NET/Mono engineering teams the time and focus to enable AOT, linker, crypto, and other very necessary things for mobile platforms
  • allow the Xamarin teams to focus on the vNext work that promises to have huge impact, specifically in the architecture of the renderers (yes, existing apps will continue to work)

Xamarin.Forms can run on .NET 5, but I imagine we actually want Android and iOS to be supported platform targets. Almost nothing we need to enable running on a new .NET exists within this repo. .NET 5 doesn't have the stuff we want. It's in .NET 6.

@YZahringer
Copy link
Contributor Author

YZahringer commented Sep 15, 2020

@davidortinau thank you for the details. Yes, the future with .NET 6 is amazing 😃

But in the meantime, we have to keep making incredible apps with Xamarin.Forms 😉

For example, we use EF Core 3.1 with SQLite in several apps. With EF Core 5.0, the .NET Standard 2.0 is no longer supported. This one requires .NET Standard 2.1, which is currently not supported by UWP. This should be fixed by new WinRT APIs support in .NET 5. This will also be supported by UWP Xamarin.Forms apps?

.NET 5 also provides performances improvements. This could also improve the performance of Xamarin apps?

C# 9 also requires .NET 5?

@jspuij
Copy link

jspuij commented Oct 21, 2020

Xamarin.Forms can run on .NET 5, but I imagine we actually want Android and iOS to be supported platform targets. Almost nothing we need to enable running on a new .NET exists within this repo. .NET 5 doesn't have the stuff we want. It's in .NET 6.

@davidortinau Just curious, but could you elaborate on the stuff that is necessary to support net5 as a platform target on iOS and Android? Mono is still a supported runtime for .NET5, specifically targeted at these platforms (and WebAssembly). Only the BCL has been replaced by the .NET core one. WebAssembly Blazor is more than happy to run .NET 5 code on Mono inside a web browser.

I figured it would be possible to just update mono and have .NET5 for free, just as we got netstandard2.1 more or less for free with Xamarin due to the mono update.

It also effectively blocks an upgrade for Mobile Blazor Bindings to .NET5 and the new Blazor. These will be forced to support the 3.2 version of Blazor for an entire year while .NET 5 Blazor with many improvements releases shortly.

@jspuij
Copy link

jspuij commented Oct 28, 2020

Found a nice list of issues for iOS/macOS because of the changes to the runtime for .NET 5: xamarin/xamarin-macios#8901.

Some more issues (and some enhancements) here:
https://github.com/xamarin/xamarin-macios/milestone/35

For mono on android:
https://github.com/xamarin/xamarin-android/milestone/21

@mrpmorris
Copy link

Blazor Mobile Bindings is near the top of my things to try. If it won't work with NET5 it looks like it has died before it even got started and so isn't even worth considering.

@skclusive
Copy link

.NET5 support required for Blazor Mobile Bindings to consume net5.0 based libraries.

if "Xamarin.Forms can run on .NET 5", please do consider for the future of Blazor Mobile Bindings to be even considered for trying out.

getting familiar with Blazor Mobile Bindings, would help us explore MAUI as well which is planned to support Blazor model as well.

@Kukks
Copy link

Kukks commented Dec 2, 2020

@YZahringer I hear you. This is unlikely to happen, and that's a good thing. By targeting .NET 6 we can:

  • continue shipping Xamarin.Forms at the current cadence of every 6 weeks
  • continue shipping Android and iOS SDK updates in a timely fashion (imagine shipping iOS 14 for 2 different versions of .NET, double the work, yikes!)
  • allow the .NET/Mono engineering teams the time and focus to enable AOT, linker, crypto, and other very necessary things for mobile platforms
  • allow the Xamarin teams to focus on the vNext work that promises to have huge impact, specifically in the architecture of the renderers (yes, existing apps will continue to work)

Xamarin.Forms can run on .NET 5, but I imagine we actually want Android and iOS to be supported platform targets. Almost nothing we need to enable running on a new .NET exists within this repo. .NET 5 doesn't have the stuff we want. It's in .NET 6.

How is it acceptable to skip an entire .NET major version for such an impactful project? Please reconsider this, especially for when the LTS candidate comes out. From my end, I would rather scrap any plans for Xamarin projects if it meant I could not use Blazor Mobile Bindings.

@mrpmorris
Copy link

@Kukks I've already decided to skip using it for this very reason.

@robloo
Copy link

robloo commented Dec 21, 2020

How is it acceptable to skip an entire .NET major version for such an impactful project?

As someone who has spent a lot of time with UWP, I understand the struggle here. We are stuck with modified .NET Core 2.x and C#7.x. This type of thinking from Microsoft is really not acceptable. Both UWP/XF were positioned as the cutting edge tech even up until about a year ago (until MAUI/WinUI 3 announcement).

I would have expected XF get better support but .NET5 missed a lot of cross-platform promises. It's disappointing @davidortinau framed this as a positive. While I understand his team's resource constraints we need to be honest. This is clearly not a positive and negatively impacts several projects/scenarios. Really hope .NET6 meets the targets.

@BurkusCat
Copy link
Contributor

BurkusCat commented Jan 4, 2021

For example, we use EF Core 3.1 with SQLite in several apps. With EF Core 5.0, the .NET Standard 2.0 is no longer supported.

I'd just like to add, EF Core 5.0 is a MASSIVE improvement for mobile apps using SQLite (dotnet/EntityFramework.Docs@c74f4ad). SQLite when used today in Xamarin.Forms with EF Core 3.1 has awful migration support.

I would say data migration is one of the biggest problems to think about in mobile development. It would be hugely beneficial to have it solved in Xamarin.Forms by supporting .NET 5 and thus EF Core 5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants