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

Fix crash in .NET 9 #118

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix crash in .NET 9 #118

wants to merge 3 commits into from

Conversation

daltzctr
Copy link

@daltzctr daltzctr commented Sep 11, 2024

  • Converts project to a newer class library. Explicit TFM is no longer necessary
  • Update obsoluted references with equivalents

Fixes #116

@roubachof
Copy link
Owner

In the referenced issue, you stated:

This is likely due to the use of reflection based bindings in Sharpnado. This is no longer allowed in .NET 9 and all bindings must be compiled (or explicitly opted out with x:DataType={x:Null}.

But I don't see any change to compiled bindings in this PR.
Moreover this PR is changing target type and swap Frame for Border, so it doesn't relate to its name (fix crash in .net9)

@daltzctr
Copy link
Author

@roubachof my apologies. I have been fixing issues in various libraries during my migration to .NET 9. As you say, the issue in Sharpnado was not reflection bindings, but actually just references to obsoleted code (Device and Frame), which result in a runtime crash.

You will notice b530513 also always utilizes a gesture instead of the effects that were previously in-place. There was an issue in my testing where the gestures would no longer trigger in .NET 8, but I can't find the related change in MAUI. Using gestures on both iOS and Android was the solution.

This may break incompatibility with .NET older than 6, but I'm not sure that's quite necessary to support and I recommend following the MAUI support lifecycle (non-LTS is supported for year of release, LTS is supported 2-3 years). In which the current supported versions of MAUI are .NET 8 and .NET 9.

I have confirmed this does not break .NET 8 on Android or iOS.

@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's certainly ok to remove net6.0, since it's out of support already (at least regarding MAUI), but shouldn't one also add net8.0 here, as it currently is the only stable MAUI version with active support?

@janusw janusw mentioned this pull request Sep 21, 2024
@dartasen
Copy link

@roubachof my apologies. I have been fixing issues in various libraries during my migration to .NET 9. As you say, the issue in Sharpnado was not reflection bindings, but actually just references to obsoleted code (Device and Frame), which result in a runtime crash.

You will notice b530513 also always utilizes a gesture instead of the effects that were previously in-place. There was an issue in my testing where the gestures would no longer trigger in .NET 8, but I can't find the related change in MAUI. Using gestures on both iOS and Android was the solution.

This may break incompatibility with .NET older than 6, but I'm not sure that's quite necessary to support and I recommend following the MAUI support lifecycle (non-LTS is supported for year of release, LTS is supported 2-3 years). In which the current supported versions of MAUI are .NET 8 and .NET 9.

I have confirmed this does not break .NET 8 on Android or iOS.

MAUI does not follow standard .NET policy, STS & LTS are following the same rule : A major version receives support for a minimum of 6 months after a successor (the next major release) ships: https://dotnet.microsoft.com/en-us/platform/support/policy/maui

@janusw
Copy link
Collaborator

janusw commented Oct 12, 2024

This may break incompatibility with .NET older than 6, but I'm not sure that's quite necessary to support and I recommend following the MAUI support lifecycle (non-LTS is supported for year of release, LTS is supported 2-3 years). In which the current supported versions of MAUI are .NET 8 and .NET 9.
I have confirmed this does not break .NET 8 on Android or iOS.

MAUI does not follow standard .NET policy, STS & LTS are following the same rule : A major version receives support for a minimum of 6 months after a successor (the next major release) ships: https://dotnet.microsoft.com/en-us/platform/support/policy/maui

Right. MAUI 6 and 7 are of out support by now, so they do not need to be supported any more by this library.

However, as written above, we'll need to keep .NET 8 support for now, so the net9.0 target frameworks will need to be added to the net8.0 ones instead of replacing them.

@janusw
Copy link
Collaborator

janusw commented Oct 12, 2024

  • Converts project to a newer class library. Explicit TFM is no longer necessary

@daltzctr Where did you get this actually? I did not see it in the .NET 9 release notes.

You will notice b530513 also always utilizes a gesture instead of the effects that were previously in-place. There was an issue in my testing where the gestures would no longer trigger in .NET 8, but I can't find the related change in MAUI. Using gestures on both iOS and Android was the solution.

This is very similar my proposed change from #126 (which was actually rejected by @roubachof). What issues did you see exactly? Do they occur also on iOS, or only on Android?

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

Successfully merging this pull request may close these issues.

[MAUI] Crashes on .NET 9
4 participants