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

Build with .NET 10 successfully #27103

Open
wants to merge 48 commits into
base: net10.0
Choose a base branch
from
Open

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Jan 13, 2025

Changes required:

  • Get appropriate net9 branded workload manifests from dotnet/runtime

  • Fix NuGet package downgrades:

    src\SingleProject\Resizetizer\src\Resizetizer.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 6.1.0 to 6.0.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Resizetizer -> Microsoft.Bcl.AsyncInterfaces 10.0.0-alpha.1.25058.4 -> System.Threading.Tasks.Extensions 4.6.0 -> System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
       Microsoft.Maui.Resizetizer -> System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
    src\Core\src\Core.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Numerics.Vectors from 4.6.0 to 4.5.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Core -> Microsoft.Extensions.Logging.Abstractions 10.0.0-alpha.1.25057.17 -> System.Memory 4.6.0 -> System.Numerics.Vectors (>= 4.6.0)
       Microsoft.Maui.Core -> System.Numerics.Vectors (>= 4.5.0)
  • Update to iOS, tvOS, MacCatalyst 18.2
    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for MacCatalyst. Valid versions include:
        18.2
    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for iOS. Valid versions include:
        18.2
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-BindableLayout-BindableLayout.cs-GeneratedBindingInterceptors-235-10.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (https://github.com/dotnet/roslyn/issues/72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-72-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (https://github.com/dotnet/roslyn/issues/72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-77-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (https://github.com/dotnet/roslyn/issues/72133)
  • iOS API changes:
    error CS0618: 'CLLocation.AccurracyBestForNavigation' is obsolete: 'Use 'AccuracyBestForNavigation' instead.'
    Screenshot.ios.cs(57,69): error CS8602: Dereference of a possibly null reference.
    Platform\iOS\KeyboardAutoManagerScroll.cs(867,55): error CS8602: Dereference of a possibly null reference.
    src\Core\src\Platform\iOS\MauiSwipeView.cs(601,8): error CS8625: Cannot convert null literal to non-nullable reference type.
    src\Core\src\Platform\iOS\MauiSwipeView.cs(634,8): error CS8625: Cannot convert null literal to non-nullable reference type.
    ResignFirstResponderTouchGestureRecognizer.iOS.cs(70,12): error CS8600: Converting null literal or possible null value to non-nullable type.
    GesturePlatformManager.iOS.cs(282,21): error CS8602: Dereference of a possibly null reference.

Most notably:

  • UIView.Window can be null.

  • Typo in API fixed AccurracyBestForNavigation -> AccuracyBestForNavigation

  • Ignore warnings related with trimming
    IL2026; IL2067;IL2072 ;IL2075;IL2087; IL2091;

  • Move to Xcode 16.2

Changes required:

* Get appropriate `net9` branded workload manifests from dotnet/runtime

* Fix NuGet package downgrades:

    src\SingleProject\Resizetizer\src\Resizetizer.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 6.1.0 to 6.0.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Resizetizer -> Microsoft.Bcl.AsyncInterfaces 10.0.0-alpha.1.25058.4 -> System.Threading.Tasks.Extensions 4.6.0 -> System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
       Microsoft.Maui.Resizetizer -> System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
    src\Core\src\Core.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Numerics.Vectors from 4.6.0 to 4.5.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Core -> Microsoft.Extensions.Logging.Abstractions 10.0.0-alpha.1.25057.17 -> System.Memory 4.6.0 -> System.Numerics.Vectors (>= 4.6.0)
       Microsoft.Maui.Core -> System.Numerics.Vectors (>= 4.5.0)

* Update to iOS, tvOS, MacCatalyst 18.2

    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for MacCatalyst. Valid versions include:
        18.2
    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for iOS. Valid versions include:
        18.2

* Temporarily ignore `CS9270`:
  * dotnet/roslyn#76312
  * dotnet/roslyn#72133

    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-BindableLayout-BindableLayout.cs-GeneratedBindingInterceptors-235-10.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-72-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-77-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)

* iOS API changes:

    error CS0618: 'CLLocation.AccurracyBestForNavigation' is obsolete: 'Use 'AccuracyBestForNavigation' instead.'

    Screenshot.ios.cs(57,69): error CS8602: Dereference of a possibly null reference.

    Platform\iOS\KeyboardAutoManagerScroll.cs(867,55): error CS8602: Dereference of a possibly null reference.

    src\Core\src\Platform\iOS\MauiSwipeView.cs(601,8): error CS8625: Cannot convert null literal to non-nullable reference type.
    src\Core\src\Platform\iOS\MauiSwipeView.cs(634,8): error CS8625: Cannot convert null literal to non-nullable reference type.

    ResignFirstResponderTouchGestureRecognizer.iOS.cs(70,12): error CS8600: Converting null literal or possible null value to non-nullable type.

    GesturePlatformManager.iOS.cs(282,21): error CS8602: Dereference of a possibly null reference.

Most notably:

* `UIView.Window` can be null.

* Typo in API fixed `AccurracyBestForNavigation` -> `AccuracyBestForNavigation`
@Copilot Copilot bot review requested due to automatic review settings January 13, 2025 16:48
@jonathanpeppers jonathanpeppers requested a review from a team as a code owner January 13, 2025 16:48
@jonathanpeppers jonathanpeppers requested review from jfversluis and jsuarezruiz and removed request for a team January 13, 2025 16:48

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 15 changed files in this pull request and generated no comments.

Files not reviewed (10)
  • Directory.Build.props: Language not supported
  • Directory.Build.targets: Language not supported
  • eng/Versions.props: Language not supported
  • src/DotNet/Dependencies/Workloads.csproj: Language not supported
  • src/Essentials/src/Compass/Compass.ios.cs: Evaluated as low risk
  • src/Core/src/Platform/iOS/MauiSwipeView.cs: Evaluated as low risk
  • eng/pipelines/ui-tests.yml: Evaluated as low risk
  • src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cs: Evaluated as low risk
  • eng/pipelines/device-tests.yml: Evaluated as low risk
  • src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)

src/Controls/src/Core/ContentPage/HideSoftInputOnTappedChanged/ResignFirstResponderTouchGestureRecognizer.iOS.cs:70

  • The forced non-null assertion 'view.Superview!' should be verified to ensure that 'Superview' is indeed never null in this context.
view = view.Superview!;

src/Essentials/src/Geolocation/GeolocationAccuracyExtensionMethods.ios.macos.cs:22

  • The typo in CLLocation.AccurracyBestForNavigation has been corrected to CLLocation.AccuracyBestForNavigation.
return CLLocation.AccuracyBestForNavigation;
@jonathanpeppers

This comment was marked as outdated.

This comment was marked as outdated.

@rmarinho

This comment was marked as outdated.

This comment was marked as outdated.

jonathanpeppers added a commit to dotnet/android that referenced this pull request Jan 13, 2025
    D:\src\maui\src\TestUtils\src\TestShared\xUnitSharedAttributes.cs(75,89): error CS0117: 'DynamicallyAccessedMemberTypes' does not contain a definition for 'PublicParameterlessConstructors'
    D:\src\maui\src\TestUtils\src\TestShared\xUnitSharedAttributes.cs(83,63): error CS0117: 'DynamicallyAccessedMemberTypes' does not contain a definition for 'PublicParameterlessConstructors'
@PureWeen PureWeen added this to the .NET 9 SR4 milestone Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants