-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
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`
There was a problem hiding this comment.
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 toCLLocation.AccuracyBestForNavigation
.
return CLLocation.AccuracyBestForNavigation;
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Testing: dotnet/maui#27103
Workaround: dotnet/android@715a36a
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'
src/TestUtils/src/DeviceTests.Runners.SourceGen/RunnerGenerator.cs
Outdated
Show resolved
Hide resolved
This reverts commit 7ed2b89.
This reverts commit 882c45e.
Context: xamarin/xamarin-macios#21351 This will avoid some of the fallout of the above PR.
Fixes? [15:12:46.2484560] 2025-01-22 15:12:46.242709-0800 RunOniOSmauiRel1586373188[97228:54445246] Received unhandled Objective-C exception that was marshalled from a managed exception: A suitable constructor for type 'Microsoft.Maui.Hosting.FontsMauiAppBuilderExtensions+FontInitializer' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor. (System.InvalidOperationException) [15:12:46.2484780] at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache, ServiceIdentifier, Type, CallSiteChain) + 0x4de [15:12:46.2485210] at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor, ServiceIdentifier, CallSiteChain, Int32) + 0x1a5 [15:12:46.2485640] at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateEnumerable(ServiceIdentifier, CallSiteChain) + 0x42f [15:12:46.2485930] at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain) + 0xfb [15:12:46.2486100] at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceIdentifier, CallSiteChain) + 0x92 [15:12:46.2486220] at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) + 0x68 [15:12:46.2486330] at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey, Func`2) + 0xdc [15:12:46.2486790] at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier, ServiceProviderEngineScope) + 0x39 [15:12:46.2486900] at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider, Type) + 0x3d [15:12:46.2487000] at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider) + 0x2f [15:12:46.2487100] at Microsoft.Maui.MauiContextExtensions.InitializeAppServices(MauiApp) + 0x1b [15:12:46.2487190] at Microsoft.Maui.Hosting.MauiAppBuilder.Build() + 0x67 [15:12:46.2487420] at Microsoft.Maui.MauiUIApplicationDelegate.WillFinishLaunching(UIApplication application, NSDictionary launchOptions) + 0x44 [15:12:46.2487530] at RunOniOSmauiRel1586373188!<BaseAddress>+0xe200a
This reverts commit 802e4c1.
Changes required:
Get appropriate
net9
branded workload manifests from dotnet/runtimeFix NuGet package downgrades:
CS9270
: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