Sharpnado.Tabs icon indicating copy to clipboard operation
Sharpnado.Tabs copied to clipboard

Fix crash in .NET 9

Open daltzctr opened this issue 1 year ago • 5 comments

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

Fixes #116

daltzctr avatar Sep 11 '24 21:09 daltzctr

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)

roubachof avatar Sep 12 '24 10:09 roubachof

@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.

daltzctr avatar Sep 12 '24 13:09 daltzctr

@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

dartasen avatar Oct 11 '24 13:10 dartasen

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 avatar Oct 12 '24 07:10 janusw

  • 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?

janusw avatar Oct 12 '24 07:10 janusw