Repository navigation
Remove XamlC for .NET 12 - #40608
Remove XamlC for .NET 12#40608
Conversation
Remove the legacy IL compiler and its build integration, packaging dependencies, and compiler-only tests. Keep SourceGen, runtime XAML loading, and compatibility attributes; reject explicit XamlC inflators with migration guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
The deleted project is still referenced by Microsoft.Maui-dev.sln with Debug and Release build entries enabled, causing solution restore or build to fail with a project-not-found error.
No open issues 🎉
1 file not reviewed
src/Controls/src/Build.Tasks/ErrorMessages.Designer.cs: Generated file
What changed in this PR
This PR retires XamlC for .NET MAUI 12, leaving SourceGen as the default and runtime XAML loading available. The reviewed changes remove compiler infrastructure and adapt tests, tooling checks, and guidance to the remaining inflators.
Changes:
- Remove XamlC helpers, compiled converters, and compiler-only tests and fixtures.
- Preserve Runtime/SourceGen coverage, update resource references, and make SourceGen the benchmark baseline.
- Update build-readiness checks and compatibility guidance while preserving compilation-option numeric values.
| File | Description |
|---|---|
| src/Maui.InTree.targets | Check SourceGen assembly readiness. |
| src/Maui.InTree.props | Check SourceGen assembly readiness. |
| src/Controls/tests/XamlC.Tests.targets | Delete XamlC-specific test settings. |
| src/Controls/tests/Xaml.UnitTests/XStaticException.rt.xaml.cs | Remove XamlC exception assertions. |
| src/Controls/tests/Xaml.UnitTests/XmlnsCollision.rt.xaml.cs | Retain Runtime/SourceGen collision checks. |
| src/Controls/tests/Xaml.UnitTests/xKeyLiteral.rt.xaml.cs | Remove XamlC validation branch. |
| src/Controls/tests/Xaml.UnitTests/XArray.xaml.cs | Remove compiler-only array inspection. |
| src/Controls/tests/Xaml.UnitTests/XamlExceptionAssert.cs | Remove build-exception helpers. |
| src/Controls/tests/Xaml.UnitTests/XamlC/ModuleDefinitionExtensionsTests.cs | Delete Cecil module tests. |
| src/Controls/tests/Xaml.UnitTests/XamlC/MethodDefinitionExtensionsTests.cs | Delete Cecil method tests. |
| src/Controls/tests/Xaml.UnitTests/X2009Primitives.xaml.cs | Narrow null-URI expectation to Runtime. |
| src/Controls/tests/Xaml.UnitTests/VisualStateManagerTests.xaml | Update explanatory comment to SourceGen. |
| src/Controls/tests/Xaml.UnitTests/Validation/TypeMismatch.rt.xaml.cs | Remove XamlC validation assertion. |
| src/Controls/tests/Xaml.UnitTests/Validation/StaticExtensionException.rt.xaml.cs | Remove XamlC exception branch. |
| src/Controls/tests/Xaml.UnitTests/Validation/SetterOnNonBP.rt.xaml.cs | Retain Runtime/SourceGen setter validation. |
| src/Controls/tests/Xaml.UnitTests/Validation/MissingXClass.rt.xaml | Add runtime-only missing-class fixture. |
| src/Controls/tests/Xaml.UnitTests/TemplateBindingsCompiler.xaml.cs | Limit typed-binding check to SourceGen. |
| src/Controls/tests/Xaml.UnitTests/Speed/SimpleContentPage.xaml.cs | Delete XamlC speed tests. |
| src/Controls/tests/Xaml.UnitTests/Speed/SimpleContentPage.xaml | Delete speed-test fixture. |
| src/Controls/tests/Xaml.UnitTests/ServiceProviderTests.xaml.cs | Exercise SourceGen service providers. |
| src/Controls/tests/Xaml.UnitTests/ResourceDictionaryWithSource.xaml.cs | Update resource paths and inflator checks. |
| src/Controls/tests/Xaml.UnitTests/ResourceDictionaryWithSource.xaml | Reference replacement runtime resources. |
| src/Controls/tests/Xaml.UnitTests/ResourceDictionaryWithInvalidSource.rt.xaml.cs | Remove XamlC invalid-source assertion. |
| src/Controls/tests/Xaml.UnitTests/PlatformViewsAndBindings.rt.xaml.cs | Remove XamlC platform cases. |
| src/Controls/tests/Xaml.UnitTests/MultipleDataTemplateChildElements.rt.xaml.cs | Remove XamlC template validation. |
| src/Controls/tests/Xaml.UnitTests/MSBuild/DummyBuildEngine.cs | Delete compiler-test build engine. |
| src/Controls/tests/Xaml.UnitTests/MockCompiler.cs | Delete XamlC test harness. |
| src/Controls/tests/Xaml.UnitTests/MockAssemblyResolver.cs | Delete Cecil test resolver. |
| src/Controls/tests/Xaml.UnitTests/MergedResourceDictionaries.xaml.cs | Remove explicit XamlC compilation. |
| src/Controls/tests/Xaml.UnitTests/LoaderTests.cs | Remove Cecil binding-type lookup. |
| src/Controls/tests/Xaml.UnitTests/Issues/XSharedNotSupported.xaml.cs | Focus test on SourceGen requirement. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui37936.xaml.cs | Retain SourceGen platform regression test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui35018.xaml.cs | Remove obsolete XamlC exclusion comment. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui34056StringAncestorType.sgen.xaml | Remove obsolete XamlC limitation comment. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui34021.xaml.cs | Remove XamlC case and format code. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui32056.xaml.cs | Remove compiler-only enum validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui31308.xaml.cs | Remove Cecil imports. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui29708.xaml.cs | Remove XamlC namespace checks. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui29589LibraryXc.xc.xaml | Delete XamlC dictionary fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui29589.xaml.cs | Retain SourceGen nested-dictionary checks. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui29422.rt.xaml.cs | Remove XamlC warning branch. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui26369.xaml.cs | Remove nullable-boxing IL inspection. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25871.xaml.cs | Delete compiler-only regression test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25871.xaml | Delete compiler-only converter fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25819.xaml.cs | Remove explicit XamlC compilation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25406.xaml.cs | Delete compiler-only service-provider test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25406.xaml | Delete associated binding fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25172.xaml | Reference replacement runtime dictionary. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25141.xaml.cs | Delete XamlC binding compilation test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui25141.xaml | Delete associated trigger fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui23989.xaml.cs | Retain SourceGen typed-binding expectation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui23961Error.xaml.cs | Remove XamlC obsolete-error validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui23961.xaml.cs | Retain obsolete-member loading checks. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui23711.xaml.cs | Delete XamlC binding-switch test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui23711.xaml | Delete associated binding fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui22714.rt.xaml.cs | Remove XamlC warning permutations. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui21757_2.xaml.cs | Retain SourceGen diagnostic case. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui21038.rt.xaml.cs | Remove XamlC parse-error branch. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui20616.xaml.cs | Limit typed-binding assertions to SourceGen. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui17484.xaml.cs | Remove XamlC obsolete-template check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui17461.xaml.cs | Pass target framework to SourceGen test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui17333.xaml.cs | Retain SourceGen OnPlatform check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui14158/WithSuffix.xaml.cs | Remove XamlC type-resolution case. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui14158/PublicTypes.xaml.cs | Remove XamlC public-type case. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui14158/InternalVisibleTypes.xaml.cs | Remove XamlC internal-type case. |
| src/Controls/tests/Xaml.UnitTests/Issues/Maui11467/Maui11467.xaml.cs | Remove XamlC event-handler case. |
| src/Controls/tests/Xaml.UnitTests/Issues/Issue2450.rt.xaml.cs | Remove XamlC exception assertion. |
| src/Controls/tests/Xaml.UnitTests/Issues/Issue10255.xaml.cs | Remove XamlC-specific version guard. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh7531.xaml.cs | Correct trimming-suppression comment. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh7531.xaml | Update runtime dictionary references. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh7187.rt.xaml.cs | Remove XamlC assignment validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh5378_2.rt.xaml.cs | Remove XamlC syntax-error check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh5378_1.rt.xaml.cs | Remove XamlC syntax-error check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh5095.rt.xaml.cs | Remove XamlC invalid-XAML check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh4751.rt.xaml.cs | Remove XamlC constructor validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh4099.rt.xaml.cs | Retain SourceGen diagnostic-location check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh3512.rt.xaml.cs | Remove XamlC duplicate-key check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh3082.rt.xaml.cs | Remove XamlC event-signature validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh2549.rt.xaml.cs | Remove XamlC namespace validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh2064.rt.xaml.cs | Remove XamlC style validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh2063.rt.xaml.cs | Remove XamlC namespace-error assertion. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh2034.xaml.cs | Retain SourceGen compilation check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh2007.rt.xaml.cs | Remove XamlC branch and processing flag. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh2007.rt.xaml | Add runtime-only reference-error fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh1978.rt.xaml.cs | Retain SourceGen error check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh13209.xaml | Reference runtime dictionary fixture. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh12025.xaml.cs | Remove XamlC attached-property check. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh11711.rt.xaml.cs | Remove XamlC format-error branch. |
| src/Controls/tests/Xaml.UnitTests/Issues/Gh11061.rt.xaml.cs | Remove XamlC binding-error branch. |
| src/Controls/tests/Xaml.UnitTests/Issues/Bz53318.rtsg.xaml.cs | Assert template behavior for both inflators. |
| src/Controls/tests/Xaml.UnitTests/Issues/Bz53203.xaml.cs | Remove compiler-only attached-property test. |
| src/Controls/tests/Xaml.UnitTests/Issues/Bz44216.rt.xaml.cs | Remove XamlC private-property validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Bz43694.rt.xaml.cs | Remove XamlC static-extension validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/Bz43450.rt.xaml.cs | Remove XamlC grid-definition validation. |
| src/Controls/tests/Xaml.UnitTests/Issues/AB946693.rt.xaml.cs | Remove XamlC exception branch. |
| src/Controls/tests/Xaml.UnitTests/InflatorSwitch/XamlInflatorXamlC.xc.xaml.cs | Delete XamlC inflator tests. |
| src/Controls/tests/Xaml.UnitTests/InflatorSwitch/XamlInflatorXamlC.xc.xaml | Delete XamlC inflator fixture. |
| src/Controls/tests/Xaml.UnitTests/GlobalXmlnsWithXStatic.xaml.cs | Remove explicit XamlC compilation. |
| src/Controls/tests/Xaml.UnitTests/FontSize.xaml.cs | Retain SourceGen converter checks. |
| src/Controls/tests/Xaml.UnitTests/FactoryMethodMissingMethod.rt.xaml.cs | Remove XamlC factory-method validation. |
| src/Controls/tests/Xaml.UnitTests/FactoryMethodMissingCtor.rt.xaml.cs | Remove XamlC constructor validation. |
| src/Controls/tests/Xaml.UnitTests/DuplicateXArgumentsElements.rt.xaml.cs | Remove XamlC duplicate-arguments validation. |
| src/Controls/tests/Xaml.UnitTests/DuplicatePropertyElements.rt.xaml.cs | Remove XamlC duplicate-property validation. |
| src/Controls/tests/Xaml.UnitTests/Directory.Build.targets | Replace deleted shared-target import. |
| src/Controls/tests/Xaml.UnitTests/DefinitionCollectionTests.xaml.cs | Remove converter IL inspection. |
| src/Controls/tests/Xaml.UnitTests/CompiledTypeConverter.xaml.cs | Retain Runtime/SourceGen converter coverage. |
| src/Controls/tests/Xaml.UnitTests/CecilExtensionsTests.cs | Delete Cecil resource tests. |
| src/Controls/tests/Xaml.UnitTests/BindingsCompiler.xaml.cs | Limit typed-binding expectation to SourceGen. |
| src/Controls/tests/Xaml.UnitTests/BindingDiagnosticsInvalidTwoWayBinding.xaml.cs | Remove XamlC diagnostics test. |
| src/Controls/tests/Xaml.UnitTests/BenchmarkNoLazy.xaml.cs | Remove XamlC initialization branch. |
| src/Controls/tests/Xaml.UnitTests/Benchmark.xaml.cs | Remove XamlC initialization and diagnostics. |
| src/Controls/tests/Xaml.UnitTests/AutoMergedResourceDictionaries.xaml | Reference replacement runtime dictionary. |
| src/Controls/tests/Xaml.UnitTests/AssemblyInfoTests.cs | Stop checking retired task assembly. |
| src/Controls/tests/Xaml.UnitTests/AppResources/RD13209.rt.xaml | Add runtime dictionary fixture. |
| src/Controls/tests/Xaml.UnitTests/AppResources/CompiledColors.rt.xaml | Add runtime colors fixture. |
| src/Controls/tests/Xaml.UnitTests/AppResources/ColorsWithAssembly.rt.xaml | Add replacement runtime colors resource. |
| src/Controls/tests/Xaml.UnitTests/AppResources/Colors.xc.xaml | Delete XamlC colors resource. |
| src/Controls/tests/Xaml.UnitTests.InternalsVisibleAssembly/Directory.Build.targets | Replace deleted shared-target import. |
| src/Controls/tests/Xaml.UnitTests.InternalsHiddenAssembly/Directory.Build.targets | Replace deleted shared-target import. |
| src/Controls/tests/Xaml.UnitTests.ExternalAssembly/Directory.Build.targets | Replace deleted shared-target import. |
| src/Controls/tests/Xaml.Benchmarks/Program.cs | Make SourceGen the benchmark baseline. |
| src/Controls/tests/SourceGen.UnitTests/SourceGenXamlCodeBehindTests.cs | Remove XamlC test permutations. |
| src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj | Remove XamlC warning exemptions. |
| src/Controls/tests/SourceGen.UnitTests/Maui40328Tests.cs | Remove XamlC inline-code cases. |
| src/Controls/tests/Maui25871Library/Maui25871Library.csproj | Delete compiler-only supporting project. |
| src/Controls/tests/Maui25871Library/CompareConverter.cs | Delete supporting converter fixture. |
| src/Controls/src/Xaml/XamlInflator.cs | Remove internal XamlC inflator value. |
| src/Controls/src/Xaml/XamlCompilationAttribute.cs | Update migration guidance; preserve enum values. |
| src/Controls/src/Xaml/Properties/AssemblyInfo.cs | Remove task-assembly friend access. |
| src/Controls/src/Core/Properties/AssemblyInfo.cs | Remove task-assembly friend access. |
| src/Controls/src/Build.Tasks/XamlCAssemblyResolver.cs | Delete XamlC assembly resolver. |
| src/Controls/src/Build.Tasks/VariableDefinitionExtensions.cs | Delete IL variable conversion helpers. |
| src/Controls/src/Build.Tasks/TypeDefinitionExtensions.cs | Delete Cecil type helpers. |
| src/Controls/src/Build.Tasks/SetResourcesVisitor.cs | Delete IL resource visitor. |
| src/Controls/src/Build.Tasks/SetFieldVisitor.cs | Delete IL field-assignment visitor. |
| src/Controls/src/Build.Tasks/Properties/AssemblyInfo.cs | Delete compiler-test friend declaration. |
| src/Controls/src/Build.Tasks/MethodReferenceExtensions.cs | Delete Cecil method-reference helpers. |
| src/Controls/src/Build.Tasks/MethodDefinitionExtensions.cs | Delete Cecil method-definition helpers. |
| src/Controls/src/Build.Tasks/MethodBodyExtensions.cs | Delete IL optimization helpers. |
| src/Controls/src/Build.Tasks/ILRootNode.cs | Delete IL-specific root node. |
| src/Controls/src/Build.Tasks/ILProcessorExtensions.cs | Delete IL append helper. |
| src/Controls/src/Build.Tasks/ILContext.cs | Delete compiler execution context. |
| src/Controls/src/Build.Tasks/GlobalSuppressions.cs | Delete compiler style suppression. |
| src/Controls/src/Build.Tasks/FieldReferenceExtensions.cs | Delete Cecil field-reference helper. |
| src/Controls/src/Build.Tasks/CompiledValueProviders/SetterValueProvider.cs | Delete compiled setter provider. |
| src/Controls/src/Build.Tasks/CompiledValueProviders/ICompiledValueProvider.cs | Delete compiled-provider contract. |
| src/Controls/src/Build.Tasks/CompiledMarkupExtensions/TypeExtension.cs | Delete compiled type extension. |
| src/Controls/src/Build.Tasks/CompiledMarkupExtensions/NullExtension.cs | Delete compiled null extension. |
| src/Controls/src/Build.Tasks/CompiledMarkupExtensions/ICompiledMarkupExtension.cs | Delete compiled-extension contract. |
| src/Controls/src/Build.Tasks/CompiledMarkupExtensions/DataTemplateExtension.cs | Delete compiled template extension. |
| src/Controls/src/Build.Tasks/CompiledMarkupExtensions/ArrayExtension.cs | Delete compiled array extension. |
| src/Controls/src/Build.Tasks/CompiledConverters/UriTypeConverter.cs | Delete compiled URI converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/TypeTypeConverter.cs | Delete compiled type converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ThicknessTypeConverter.cs | Delete compiled thickness converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/RowDefinitionCollectionTypeConverter.cs | Delete compiled row-collection converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/RectangleTypeConverter.cs | Delete compiled rectangle converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/PointTypeConverter.cs | Delete compiled point converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ListStringTypeConverter.cs | Delete compiled string-list converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/LayoutOptionsConverter.cs | Delete compiled layout-options converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ImageSourceTypeConverter.cs | Delete compiled image-source converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ICompiledTypeConverter.cs | Delete converter contract and test helper. |
| src/Controls/src/Build.Tasks/CompiledConverters/GridLengthTypeConverter.cs | Delete compiled grid-length converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/FontSizeTypeConverter.cs | Delete compiled font-size converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/FlexBasisTypeConverter.cs | Delete compiled flex-basis converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/EnumTypeConverter.cs | Delete compiled enum converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/EasingTypeConverter.cs | Delete compiled easing converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/CornerRadiusTypeConverter.cs | Delete compiled corner-radius converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ConstraintTypeConverter.cs | Delete compiled constraint converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ColumnDefinitionCollectionTypeConverter.cs | Delete compiled column-collection converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/ColorTypeConverter.cs | Delete compiled color converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/BrushTypeConverter.cs | Delete compiled brush converter. |
| src/Controls/src/Build.Tasks/CompiledConverters/BoundsTypeConverter.cs | Delete compiled bounds converter. |
| src/Controls/src/Build.Tasks/BindablePropertyReferenceExtensions.cs | Delete Cecil bindable-property helpers. |
| docs/design/NuGets.md | Describe SourceGen build-package responsibilities. |
| .github/scripts/Review-PR.ps1 | Check SourceGen in copied build artifacts. |
| .github/instructions/xaml-unittests.instructions.md | Update guidance for remaining inflators. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Deleting the project while leaving its entry and build configurations in Microsoft.Maui-dev.sln breaks solution restore/build and IDE project loading.
No open issues 🎉
1 file not reviewed
src/Controls/src/Build.Tasks/ErrorMessages.Designer.cs: Generated file
Review effort: Balanced
|
/review expert-review |
There was a problem hiding this comment.
Expert Review — 2 findings
Reviewed commit 0810655.
Source assessment incomplete (9/10 dimensions); finding count is partial.
2 findings could not be attached inline; retained in run artifacts.
| Copy-Item -LiteralPath $rawBuildTasks -Destination $candidateBuildTasks -Recurse -Force -ErrorAction Stop | ||
| $prPlusBuildTasksReady = | ||
| (Test-Path -LiteralPath (Join-Path $candidateBuildTasks 'Microsoft.Maui.Controls.Build.Tasks.dll')) -and | ||
| (Test-Path -LiteralPath (Join-Path $candidateBuildTasks 'Microsoft.Maui.Controls.SourceGen.dll')) -and |
There was a problem hiding this comment.
Is this correct? SourceGen isn't a build tasks dll, is it?
| <_MauiCoreAfterBuildTasksTargets>$(_MauiBuildTasksLocation)Microsoft.Maui.Core.After.targets</_MauiCoreAfterBuildTasksTargets> | ||
| <_MauiResizetizerBuildTasksTargets>$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.targets</_MauiResizetizerBuildTasksTargets> | ||
| <_MauiBuildTasksTargetsReady Condition="Exists('$(_MauiCoreBuildTasksTargets)') and Exists('$(_MauiControlsBuildTasksTargets)') and Exists('$(_MauiCoreAfterBuildTasksTargets)') and Exists('$(_MauiResizetizerBuildTasksTargets)') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.Build.Tasks.dll') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.dll')">true</_MauiBuildTasksTargetsReady> | ||
| <_MauiBuildTasksTargetsReady Condition="Exists('$(_MauiCoreBuildTasksTargets)') and Exists('$(_MauiControlsBuildTasksTargets)') and Exists('$(_MauiCoreAfterBuildTasksTargets)') and Exists('$(_MauiResizetizerBuildTasksTargets)') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.SourceGen.dll') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.dll')">true</_MauiBuildTasksTargetsReady> |
| <_MauiControlsBuildTasksProps Condition="'$(_MauiTargetPlatformIsWindows)' == 'true'">$(_MauiBuildTasksLocation)net6.0-windows10.0.17763.0\Microsoft.Maui.Controls.Build.Tasks.props</_MauiControlsBuildTasksProps> | ||
| <_MauiResizetizerBuildTasksProps>$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.props</_MauiResizetizerBuildTasksProps> | ||
| <_MauiBuildTasksPropsReady Condition="Exists('$(_MauiCoreBuildTasksProps)') and Exists('$(_MauiControlsBuildTasksProps)') and Exists('$(_MauiResizetizerBuildTasksProps)') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.Build.Tasks.dll') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.dll')">true</_MauiBuildTasksPropsReady> | ||
| <_MauiBuildTasksPropsReady Condition="Exists('$(_MauiCoreBuildTasksProps)') and Exists('$(_MauiControlsBuildTasksProps)') and Exists('$(_MauiResizetizerBuildTasksProps)') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.SourceGen.dll') and Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.dll')">true</_MauiBuildTasksPropsReady> |
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check Simon's suggestions?
The #40608 snapshot targets net11.0 with an optional previous net10.0 TFM. Restore the NET11_0_OR_GREATER guards removed by the prerequisite so net10 builds keep AppThemeBinding internal, omit the GridLength implicit string conversion, and omit the four .NET 11 RuntimeFeature attribute groups, along with the tests that depend on those APIs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `4c07c58ee4f39fb46833e04176934d2c179d0548` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 7.5/10 | ↑ Core (7683), Xaml (2335), SourceGen (915) and BindingSourceGen (157) unit tests pass, and so does every intermediate commit.<br>↑ The 106 compatibility tests run every scenario with both constructors. Of their 105 test cases that also run on main, 61 pass on main as well and 44 fail there and pass with this PR.<br>↑ Ten review rounds by three models ended with no objections.<br>↑ Paired BenchmarkDotNet runs against the merge base.<br>↓ Core binding infrastructure with a large blast radius. No device, UI or integration tests, and no CI run yet.<br>↓ Leaf updates through the legacy constructor, which code compiled before this PR (including XamlC output) calls, are 3–11% slower (about 2 ns per update). | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change <!-- Enter description of the fix in this section --> Compiled bindings (`TypedBinding<TSource, TProperty>`) come from BindingSourceGen (`SetBinding` and `BindingBase.Create` lambdas), the XAML source generator and the deprecated XamlC. All three call the constructor that takes an array of handlers. Today these bindings observe every object on their path through one `PropertyChangedProxy` and one `WeakPropertyChangedProxy` per path part. When an observed object changes, those proxies subscribe again, allocating new weak references and delegates. Each part also has its own finalizer, and nothing handles user code that changes the path while the binding observes it. This PR replaces the proxies with one subscription store per binding. It adds a constructor that generated code uses to report the observed objects without a delegate per part, and switches both source generators to that constructor. The handler-array constructor keeps working, on the same engine, for code compiled before this change. #### Runtime (`TypedBinding.cs`, new `TypedBindingListeners.cs`) - **Subscriptions.** Each applied binding has one `TypedBindingSubscriptions`, created on its first apply. A position of the path keeps its listener and event handler while the same object and property are reported there. So leaf changes, context swaps and intermediate replacements don't allocate. - **Lifetime.** As before, the observed object references a small listener, and the listener references the binding weakly. When a binding is collected while it still observes objects that outlive it, a finalizer removes its handlers. There is one finalizer per binding instead of one per path part. An explicit removal that leaves no handler suppresses the finalizer, which halves the cost of creating, applying and removing a binding. Applying the binding again re-registers it. - **Constructor for generated code.** `TypedBinding(getter, setter, int listenerCount, TypedBindingSubscriber<TSource> subscriber)`. The subscriber reads the path and calls `TypedBindingListeners.Listen(part, propertyName)` for each observed property, in order, and returns at the first null object. When a binding observes only its source, notifications from the source don't run the subscriber again. - **Legacy constructor.** It copies its handler array, as before, and walks it with the same engine. This PR doesn't change XamlC, which emits this constructor until #40608 removes XamlC. The constructor stays after that: it's public API, and libraries compiled against earlier versions call it, whether their bindings came from XamlC or from either source generator. - **Reentrancy.** User code in event accessors, property getters, converters and binding diagnostic handlers can apply, unapply, remove or move the binding while it observes the path. - The latest walk owns the subscriptions. - Applies and unapplies requested while an event accessor runs are deferred until it returns, then settled synchronously. - Long chains of objects selected by event accessors are followed with the same result as on main. Main recursed through such chains and overflowed the stack below 1,000 objects on a 1 MB stack. - A path that keeps changing for 100,000 rounds stops with a diagnostic instead of hanging or overflowing the stack. - A binding that is being removed isn't applied to its target again. - **Exceptions.** An exception from an event accessor, or from reading a part of the path, becomes a binding diagnostic, using the existing "Exception thrown from getter: …" message or a new "Exception thrown while removing a property change handler: …". On main it escaped into `SetBinding`, `RemoveBinding`, the `BindingContext` setter, or the property setter that raised the change. The rest of the path stays observed, and the next walk retries the failed subscription. #### Generators - **BindingSourceGen** emits a subscriber instead of the handler array. It evaluates the same prefixes of the path as before, so property getters run as often. Objects whose type can't notify are read but not observed: enums, arrays, delegates, and sealed classes and structs of the core library, such as `string` and `DateTime`. Value types declared in source are observed, because IL weavers can make them notify. - **XAML source generator.** Compiled bindings use the same emission. C# expression bindings (`{= ...}`) emit a subscriber that evaluates each member chain independently. So a null object, `Nullable<T>.Value` without a value, or a member that throws in one chain doesn't stop the binding from observing the others. A chain whose owner type can't be resolved is read through its original expression and is always observed. #### Behavior changes `TypedBindingCompatibilityTests` has 106 tests, which run every scenario with both constructors. I compiled a copy against main with only the handler-array constructor. It leaves out 6 tests that need the new constructor and 4 cycles that overflow the stack or hang on main. Of its 105 test cases, 61 pass on main as well. 44 fail on main and pass with this PR: - **Subscriptions that main leaves behind, duplicates or loses:** - handlers on the rest of the path after an intermediate object becomes null or stops implementing `INotifyPropertyChanged`; - a handler on every object of a chain that event accessors select; - duplicated or lost handlers when user code changes the path while it is observed; - notifying value types whose handlers accumulate and keep the target alive; - notifications queued before an unapply that applied the binding afterwards. - **Exceptions from event accessors and from reading the path** that escaped on main, as described above. - **Removed or replaced bindings** that user code reactivated while they were removed. The other 61 cases and the existing binding tests cover behavior that doesn't change. #### API New types in `Microsoft.Maui.Controls.Internals`, hidden from IntelliSense like the rest of the typed binding API, for generated code: - `TypedBindingSubscriber<TSource>`; - `TypedBindingListeners`, a `ref struct` with `Listen(object? part, string propertyName)`; - the `TypedBinding` constructor above. `PublicAPI.Unshipped.txt` is updated for all six targets. #### Performance BenchmarkDotNet, `src/Core/tests/Benchmarks`: the new `TypedBindingDepthBenchmarker` and `TypedBindingIntermediateBenchmarker`, plus `TypedBindingScenarioBenchmarker`. The benchmark sources are identical on both sides. Runs went main, this PR, this PR, main, and the charts show the minimum. Apple Silicon, .NET 12. - *Generated* bindings come from BindingSourceGen (`BindingBase.Create`); on main its output uses the handler-array constructor. - *Legacy* bindings use the handler-array constructor, as XamlC output and code compiled before this PR do. - Depth, on the x-axis, is the number of objects on the path, counting the source.   Leaf updates through the handler-array constructor cost about 1–2.3 ns more per notification (+3–11%). That is the bookkeeping that keeps reentrant changes and accessor exceptions safe. Generated bindings, which the source generators now produce, are at parity. Libraries compiled before this PR, including XamlC output, keep the handler-array constructor until they're rebuilt.  A context swap allocates 40 B at every depth, which doesn't depend on the path. Replacing an intermediate object allocates nothing. Creating, applying and removing a binding allocates 15–42% less from depth 2 on. At depth 1, a generated binding allocates 80 B less and a legacy binding 16 B more. The scenario benchmark uses handler-array bindings:  <details> <summary>All numbers</summary> Time per operation; main → this PR: | Operation | Depth | Generated | Legacy | |---|---:|---|---| | Leaf property changes | 1 | 21.6 → 21.5 ns (−0.7%) | 21.7 → 23.9 ns (+10.5%) | | | 2 | 23.9 → 24.7 ns (+3.0%) | 23.9 → 25.5 ns (+6.7%) | | | 3 | 26.0 → 26.1 ns (+0.5%) | 25.8 → 27.4 ns (+6.3%) | | | 5 | 29.3 → 30.2 ns (+3.1%) | 29.4 → 30.7 ns (+4.5%) | | | 7 | 35.2 → 33.1 ns (−5.9%) | 33.0 → 34.1 ns (+3.3%) | | Binding context swap | 1 | 154 → 75.2 ns (−51%) | 150 → 74.7 ns (−50%) | | | 2 | 271 → 90.8 ns (−66%) | 261 → 91.0 ns (−65%) | | | 3 | 369 → 105 ns (−72%) | 380 → 102 ns (−73%) | | | 5 | 594 → 127 ns (−79%) | 607 → 139 ns (−77%) | | | 7 | 822 → 165 ns (−80%) | 812 → 170 ns (−79%) | | First object after the source replaced | 2 | 126 → 35.9 ns (−71%) | 126 → 37.3 ns (−70%) | | | 3 | 231 → 48.6 ns (−79%) | 234 → 50.3 ns (−79%) | | | 5 | 461 → 83.1 ns (−82%) | 461 → 78.7 ns (−83%) | | | 7 | 699 → 117 ns (−83%) | 698 → 105 ns (−85%) | | Create, apply and remove a binding | 1 | 702 → 306 ns (−56%) | 607 → 297 ns (−51%) | | | 2 | 1,139 → 378 ns (−67%) | 1,050 → 389 ns (−63%) | | | 3 | 1,471 → 451 ns (−69%) | 1,508 → 477 ns (−68%) | | | 5 | 2,303 → 610 ns (−73%) | 2,222 → 661 ns (−70%) | | | 7 | 3,024 → 770 ns (−75%) | 2,919 → 841 ns (−71%) | Bytes allocated per operation; main → this PR. Leaf property changes allocate nothing on either side. | Operation | Depth | Generated | Legacy | |---|---:|---|---| | Binding context swap | 1 | 200 → 40 B (−80%) | 200 → 40 B (−80%) | | | 2 | 360 → 40 B (−89%) | 360 → 40 B (−89%) | | | 3 | 520 → 40 B (−92%) | 520 → 40 B (−92%) | | | 5 | 840 → 40 B (−95%) | 840 → 40 B (−95%) | | | 7 | 1,160 → 40 B (−97%) | 1,160 → 40 B (−97%) | | First object after the source replaced | 2 | 160 → 0 B (−100%) | 160 → 0 B (−100%) | | | 3 | 320 → 0 B (−100%) | 320 → 0 B (−100%) | | | 5 | 640 → 0 B (−100%) | 640 → 0 B (−100%) | | | 7 | 960 → 0 B (−100%) | 960 → 0 B (−100%) | | Create, apply and remove a binding | 1 | 880 → 800 B (−9.1%) | 800 → 816 B (+2.0%) | | | 2 | 1,392 → 1,048 B (−25%) | 1,312 → 1,112 B (−15.2%) | | | 3 | 1,904 → 1,296 B (−32%) | 1,824 → 1,408 B (−23%) | | | 5 | 2,928 → 1,792 B (−39%) | 2,848 → 2,000 B (−30%) | | | 7 | 3,952 → 2,288 B (−42%) | 3,872 → 2,592 B (−33%) | Scenario benchmark, per operation: | Scenario | Main | This PR | Change | Allocated | |---|---:|---:|---:|---| | Leaf change | 24.5 ns | 24.4 ns | −0.4% | 24 → 24 B | | Deep leaf change | 28.2 ns | 27.0 ns | −4.3% | 24 → 24 B | | Indexer change | 26.6 ns | 23.0 ns | −13.5% | 232 → 232 B | | Context swap | 647 ns | 145 ns | −77.6% | 983 → 183 B | | Intermediate replace | 698 ns | 148 ns | −78.8% | 920 → 120 B | | Create, apply and remove (leaf) | 717 ns | 378 ns | −47.2% | 1,720 → 1,736 B | | Create, apply and remove (TwoWay child) | 1,169 ns | 579 ns | −50.4% | 2,520 → 2,320 B | | Create, apply and remove (deep) | 2,312 ns | 755 ns | −67.3% | 3,880 → 3,032 B | | Create, apply and remove (OneTime deep) | 1,488 ns | 228 ns | −84.7% | 2,328 → 1,336 B | </details> #### Tests All on macOS (Apple Silicon) with `-c Debug -f net12.0 -p:MauiPlatforms= -p:IncludePreviousTfms=false -p:PublicApiType=Validate`: | Command | Result | |---|---| | `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj` | Passed: 7683, skipped: 30, failed: 0 | | `dotnet test src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj` | Passed: 2335, skipped: 8, failed: 0 | | `dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj` | Passed: 915, skipped: 71, failed: 0 | | `dotnet test src/Controls/tests/BindingSourceGen.UnitTests/Controls.BindingSourceGen.UnitTests.csproj` | Passed: 157, failed: 0 | - Every commit builds, and its suites pass on their own. With the runtime only, and again with the runtime plus BindingSourceGen, the suites pass with the generators of that commit: Core 7683, Xaml 2331, SourceGen 910, BindingSourceGen 135 and then 157. - New tests: - `TypedBindingCompatibilityTests`: binding scenarios, both constructors. - `MayNotifyPropertyChangedTests` and the updated BindingSourceGen snapshots. - `CSharpExpressionListenersTests`: generated subscribers. - `CSharpExpressionListeners.sgen.xaml`: C# expression bindings at run time. - New or updated XAML compiled binding tests. `BindingsCompiler` runs with every inflator, so XamlC output also runs on the new engine, through the handler-array constructor. - Not run: device tests, UI tests, integration tests, and Windows, Android and iOS. Benchmarks: from `artifacts/bin/Core.Benchmarks/Release/net12.0` of each worktree: ``` dotnet Core.Benchmarks.dll --filter '*TypedBindingDepthBenchmarker*' '*TypedBindingIntermediateBenchmarker*' '*TypedBindingScenarioBenchmarker*' --iterationCount 10 --iterationTime 120 --warmupCount 3 --launchCount 1 ``` #### Commits 1. Add typed binding compatibility and benchmark baseline 2. Add typed binding depth benchmarks 3. Observe typed binding paths with one subscription store (runtime, public API, Core tests) 4. Generate typed binding subscribers in BindingSourceGen 5. Generate typed binding subscribers in the XAML source generator 6. Clarify which code calls the handler-array TypedBinding constructor (benchmark comments only) ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> This supersedes #32382, which targeted `net11.0`, is out of date with `main` and still has changes requested. The compatibility tests also cover the scenarios of #34428, #34496, #36444, #37095, #38056, #38667, #39470 and #40157, which main already fixes. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, the agent opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Resolve the XamlC removal against upstream changes, update build-task readiness checks, and remove obsolete fixtures and localization inputs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Retiring the shared XAML compiler is a cross-platform breaking change requiring maintainer review of packaging, runtime fallback, and Hot Reload because validation lacks all-platform prerequisite builds and device/UI execution.
No open issues 🎉
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — No more findings
Reviewed commit 4e642f5.
Selected Tests
🧪 Test selection — click to expand
🧪 UI tests — the full suite on every platform❌ Could not queue GPT-6.2 Sol: XamlC retirement changes the shared .NET MAUI build path, so run the full UI suite on all four platforms. 🧪 Running — 77 categories on Android, iOS, MacCatalyst, WindowsThe complete 🧪 Device tests — the full suite on every platform❌ Could not queue GPT-6.2 Sol: Run the full device suite on all four platforms because shared MAUI tooling imports change how device test apps build. 🧪 Running — 105 categories on Android, iOS, MacCatalyst, WindowsThe complete 🤖 Why these tests — AI rationale (GPT-6.2 Sol + MAI Code 2)UI testsEach model chose independently; every test that runs was selected by at least one of them.
GPT-6.2 Sol — XamlC retirement changes the shared .NET MAUI build path, so run the full UI suite on all four platforms.
MAI Code 2 — Repository-wide XAML build and source-generation changes; run the complete UI suite on every platform.
Device testsEach model chose independently; every test that runs was selected by at least one of them.
GPT-6.2 Sol — Run the full device suite on all four platforms because shared MAUI tooling imports change how device test apps build.
MAI Code 2 — Repository-wide XAML build and source-generation changes; run the complete device suite on every platform.
Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification. |
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `8c97daa2f6953333e3773e2366f67180d368ff2a` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8/10 | ↑ Rebased conflict-free onto main `0806e8de4c`; main's only new netstandard guard (HotReloadHelper.cs) is removed, and remaining `NETSTANDARD` uses in libraries are in files linked into netstandard2.0 SourceGen.<br>↑ Platform-disabled net12.0+net11.0 builds of Core and Controls.Core (`IncludePreviousTfms=true`) and the netstandard2.0 Controls.SourceGen passed with 0 warnings and 0 errors.<br>↑ At this head: Graphics 406, Essentials 520, Core 1355, SourceGen 928 (71 skipped) and Xaml 1652 (3 skipped) tests passed.<br>↓ Controls.Core.UnitTests: 7740 passed, 30 skipped, 31 failed. These are the same 31 GC-collection leak tests that failed on the earlier base `77f939a75b`; they were not re-run on main `0806e8de4c`.<br>↓ Android/iOS/Mac Catalyst/Windows/macOS TFMs, packaging and external netstandard consumers not validated.<br>↓ CI pending or not inspected. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! > [!IMPORTANT] > **Intentional breaking change for review.** MAUI runtime libraries stop shipping `netstandard2.0`/`netstandard2.1` reference assets. External libraries that multi-target netstandard against MAUI, design-time tools and external backends may stop resolving compatible assets. Reviewers need to confirm this is acceptable for .NET 12 before merge; local test success does not answer the compatibility question. <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is .NET 12 modernization targeting `main`. XamlC removal (#40608) has merged (`77f939a75b9bd7434e5abf1ed603310597be692b`). This branch is rebased onto later main `0806e8de4c68667b01d434d4fd6d33ffdaebe761`. Main builds `net12.0`, with optional previous `net11.0`. This is the bottom layer of a stack; the later layers are project-specific performance PRs. ### Description of Change <!-- Enter description of the fix in this section --> With XamlC gone, MAUI runtime libraries no longer need netstandard targets. This shared prerequisite removes them and the version guards that became obsolete. It necessarily touches multiple projects and contains no performance changes. **1. Remove obsolete .NET version preprocessor conditions** (124 files) Removes `NET5`–`NET11` `*_OR_GREATER` conditions and similar guards that are always true on net12.0/net11.0. Guards still needed are kept: - `NET12_0_OR_GREATER` - guards in source generators - guards in emitted user code - guards in sources linked into netstandard2.0 tooling **2. Drop netstandard targets from MAUI libraries** (256 files, mostly deleted netstandard PublicAPI baselines) Removes `netstandard2.0`/`netstandard2.1` from these libraries: - Core - Controls.Core - Controls.Xaml - Essentials - Graphics and Graphics.Skia - Core and Controls Maps - Controls.NuGet - Core.ExternalBackend CustomAttributes, GraphicsTester.Portable and Graphics.Text.Markdig now use `$(_MauiDotNetTfm)`. The commit also: - removes the library-only netstandard PublicAPI baselines, package references and polyfills - simplifies `NETSTANDARD` branches in library-only code, keeping the default interface member branch (`ILabel.IsTextSelectable`, `IImage.Metadata`/`Save`/`SaveAsync`, `IImageLoadingService.FromStream(…, ImageLoadOptions?)`, `IQueryAttributable.ApplyQueryProperties`) - updates the ExternalBackend tests and docs **3. Remove the netstandard-only `ExperimentalAttribute` polyfill** `Controls/Core/Animations/ExperimentalAttribute.cs` was compiled only for `!NET8_0_OR_GREATER`, so it is now dead code. **4. Include Essentials/Graphics previous TFMs with `IncludePreviousTfms`** Previously, `-p:IncludePreviousTfms=true` built net11.0 Core/Controls against the netstandard2.1 Essentials/Graphics assets. Without those assets, restore failed with NU1201. `IncludePreviousTfmsEssentials`/`IncludePreviousTfmsGraphics` now default to `$(IncludePreviousTfms)`. Default builds stay net12.0-only, and an explicit `-p:IncludePreviousTfmsEssentials=false` still wins. **5. Remove the netstandard guard from `HotReloadHelper`** Newer main (aa118ce, #29952) added `#if !NETSTANDARD` around `[RequiresDynamicCode]` in `src/Core/src/HotReload/HotReloadHelper.cs`. Core no longer targets netstandard and no netstandard project links this file, so the guard is always true and has been removed. Main added no other netstandard guards or netstandard project references after #40608. **Tooling keeps netstandard2.0.** These projects still target `netstandard2.0`, so source linked into them must stay netstandard-compatible: - Controls.SourceGen - BindingSourceGen - HybridWebViewSourceGen - Build.Tasks - build/test tooling: DotNet, Workloads, Provisioning, TestUtils, VisualTestUtils Shared files linked into SourceGen keep their guards: XamlParseException, XmlName, XmlType, XamlNode, XamlParser, ColorUtils and AllowImplicitXmlnsDeclarationAttribute. This is not a repository-wide netstandard removal. **Rebase notes.** An earlier draft carried a commit restoring `NET11_0_OR_GREATER` guards, needed only while the parent snapshot targeted net11/net10. On main (net12/net11) those guards are always true, so the commit was dropped. Conflict resolutions: - `RemappingHelper.cs`: kept main's deletion (#40728). - `RuntimeFeature.cs`: kept main's removal of `IsQueryPropertyAttributeSupported`. - `iOS/ApplicationExtensions.cs`: kept main's formatting. - netstandard PublicAPI files that main had modified: deleted only after confirming all of main's additions exist in the `net` baselines. **Benchmarks:** this prerequisite claims no performance gains. Before/after measurements for the important operations are in the later project-specific PRs in this stack. **Validation** All results are at head `8c97daa2f6953333e3773e2366f67180d368ff2a`. Setup: - SDK `12.0.100-alpha.1.26523.103` from `global.json`, repo-local `./.dotnet`. - `$P` = `-p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false` - Tests ran with `LC_ALL=en_US.UTF-8`. | Command | Result | |---|---| | `dotnet build src/Core/src/Core.csproj $P -p:IncludePreviousTfms=true` | 0 warnings, 0 errors (Graphics, Essentials, Core for net12.0 + net11.0) | | `dotnet build src/Controls/src/Core/Controls.Core.csproj $P -p:IncludePreviousTfms=true` | 0 warnings, 0 errors (net12.0 + net11.0). Before commit 4: NU1201 (Essentials/Graphics not compatible with net11.0) | | `dotnet build src/Controls/src/SourceGen/Controls.SourceGen.csproj` | 0 warnings, 0 errors (netstandard2.0) | | `dotnet test src/Graphics/tests/Graphics.Tests/Graphics.Tests.csproj $P` | 406 passed, 0 failed | | `dotnet test src/Essentials/test/UnitTests/Essentials.UnitTests.csproj $P` | 520 passed, 0 failed | | `dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj $P` | 1355 passed, 0 failed | | `dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj $P` | 928 passed, 71 skipped, 0 failed | | `dotnet test src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj $P` | 1652 passed, 3 skipped, 0 failed | | `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj $P` | 7740 passed, 30 skipped, 31 failed. All 31 failures are GC-collection leak assertions (`CommandsSubscribedToCanExecuteCollect` ×18, `LayoutDoesNotLeakAfterChildRemoved` ×4, `DoesNotLeak` ×2, `TransformGroupTests` ×3, `RowDefinitionDoesNotLeak`, `RemovingValueDoesNotLeak`, `RemovingLastValueDoesNotLeak`, `IndicatorViewItemsSourceDoesNotLeak`). An earlier run on base `77f939a75b` without this PR had the same 31 failures; they were not re-run on main `0806e8de4c` | **Not validated:** - Android/iOS/Mac Catalyst/Windows/macOS TFMs were not compiled locally. - Packaging and external netstandard consumers. - CI is still pending. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> N/A — .NET 12 framework prerequisite, no tracking issue. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `72c2b3e58cc1c96d785c1d258d1a3cb080ba37ec` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 7.5/10 | ↑ Graphics-only patch remains byte-for-byte identical after rebasing onto the finalized prerequisite; no conflicts.<br>↑ Build and full Graphics.Tests passed on this exact head: 476/476 on net12.0 with platform TFMs disabled.<br>↑ Inherited report: 300,000 generated paths matched old vs new; not reproduced here.<br>↓ Public ParseFloat(null) exception type changes; malformed-path nontermination remains.<br>↓ Benchmarks and external netstandard compatibility not revalidated; CI results have not been evaluated. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is next-major (.NET 12) work stacked on #40775 (`simonrozsival-modern-framework-prerequisite`, final head `8c97daa2f6953333e3773e2366f67180d368ff2a`). The stack now includes current `main` (`0806e8de4c`) with #40608 merged. The current snapshot builds Graphics.Tests for `net12.0`; the intended eventual integration target is `main`. The PR base and GitHub stack metadata are unchanged. ### Description of Change <!-- Enter description of the fix in this section --> Uses span APIs (`MemoryExtensions.Split` into `stackalloc Range[]`, span numeric parsing) enabled by the prerequisite removing Graphics' `netstandard` targets. - **`PathBuilder`** — SVG path-data parsing uses a single-pass span tokenizer instead of chained string replacements, string splits, per-token substrings and a string-token stack. A string replacement still runs when the data contains `Infinity`. Existing non-SVG recovery quirks (`1.5.5`, `0011` arc flags, extra `m` pairs treated as move-tos) are intentionally retained; this is not a general SVG correctness fix. - **`Point`/`PointF`/`Size`/`SizeF`/`Rect`/`RectF.TryParse`** — split into stack ranges and parse spans with the same required part counts, numeric types, `NumberStyles` and invariant culture. `SizeF` continues to parse doubles before constructing its result. - **`Insets`/`InsetsF.Parse`** — span parsing; still returns zeros on invalid input and ignores entries after the first four, but no longer throws/catches internally. Invalid-input debug output becomes a parsing diagnostic rather than an exception dump. - **`Insets`/`InsetsF.ToParsableString`** — formats with `string.Create(CultureInfo.InvariantCulture, $"{_top},{_left},{_bottom},{_right}")` instead of concatenating four invariant strings; order, comma separators and invariant numeric formatting are unchanged. - **`TextColors`** — hex parsing uses spans instead of substrings or interpolated strings; result arrays remain allocated. `Graphics.Text.Markdig` is a separate project and deliberately excluded from this layer. Its CSS optimization, tests, benchmark and supporting project references belong to a subsequent stack layer. ### Benchmarks **Inherited evidence from the supplied combined implementation; not rerun by this session.** BenchmarkDotNet, Release, `--job short --inProcess` (Apple Silicon). **The exact benchmark host runtime was not preserved.** Allocation numbers are the stronger signal; short-run timings are noisy and do not establish real-world application gains. The complete original command and raw benchmark artifacts were not supplied in the starting body. These measurements predate the rebase onto the net12.0 snapshot; only Graphics operations belonging to this layer are shown below. | Operation | Mean before | Mean after | Allocated before | Allocated after | |---|---:|---:|---:|---:| | **`PathBuilder.Build` (complex SVG path)** | **19.45 µs** | **9.92 µs** | **48.9 KB** | **3.07 KB** | | `Point.TryParse` | 54.05 ns | 50.40 ns | 112 B | 0 B | | `PointF.TryParse` | 51.57 ns | 45.82 ns | 112 B | 0 B | | `Size.TryParse` | 52.42 ns | 53.13 ns | 112 B | 0 B | | `SizeF.TryParse` | 52.17 ns | 46.04 ns | 112 B | 0 B | | `Rect.TryParse` | 98.46 ns | 88.27 ns | 192 B | 0 B | | `RectF.TryParse` | 100.49 ns | 88.48 ns | 192 B | 0 B | | `Insets.Parse` | 92.26 ns | 78.25 ns | 216 B | 48 B | | `InsetsF.Parse` | 94.20 ns | 79.33 ns | 200 B | 32 B | | `TextColors.ParseAsInts` | 48.99 ns | 8.97 ns | 136 B | 40 B | | `TextColors` parse | 28.83 ns | 13.83 ns | 168 B | 40 B | New benchmarks: `src/Graphics/tests/Graphics.Benchmarks/ParseBenchmarker.cs` (existing `PathBenchmarker` covers `PathBuilder`). `ToParsableString` was not benchmarked. ### Behaviour notes - **Known public behavior change:** `PathBuilder.ParseFloat(null)` now throws `Exception` instead of `NullReferenceException`; behavior is not universally identical. - Existing, unchanged issue: parsing can loop forever when path data starts with a number or a number follows `Z`/an unknown command. Not addressed here. - Not touched: `ColorUtils.cs` and `NumericExtensions.cs` (linked into the `netstandard2.0` SourceGen). - External libraries/tools that depend on MAUI `netstandard2.0`/`netstandard2.1` reference assemblies still require compatibility evaluation for the prerequisite's target removal. Merging XamlC removal does not establish that compatibility. ### Validation **Current rebased head `72c2b3e58cc1c96d785c1d258d1a3cb080ba37ec`:** - `dotnet test src/Graphics/tests/Graphics.Tests/Graphics.Tests.csproj -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false --verbosity quiet` — **passed**, including build: 476 succeeded, 0 failed, 0 skipped on `net12.0` (arm64). - `git diff --check 8c97daa HEAD` — **passed**; net diff remains 13 Graphics files. - Compared full net Graphics patches before and after this prerequisite resync — byte-for-byte identical. Rebase had no conflicts; Markdig source and project-reference changes remain absent. No implementation changes were made during this resync. **Prior validation, not current-head evidence:** - On the earlier rebased heads `9cad704b6909ba79c91b3e66060b3a6edc14c4c1` and `0b1f29db15f932547bdab8db2cb9d92f6197a8e4`, the same full-suite command passed 476/476 on `net12.0`. - On pre-rebase `fc9e228df9def1b7dc3995d437a27ef9ac77f200`, the same full-suite command passed 473/473 on `net11.0`; with `--filter 'FullyQualifiedName~ParseTests'` it passed 30/30. Platform TFMs were disabled in both runs. - `dotnet format whitespace src/Graphics/tests/Graphics.Tests/Graphics.Tests.csproj --no-restore --include src/Graphics/src/Graphics/Insets.cs src/Graphics/src/Graphics/InsetsF.cs src/Graphics/tests/Graphics.Tests/ParseTests.cs --verbosity quiet` — passed before rebase; the net patch is unchanged. - Earlier unfiltered platform restore attempts were blocked by missing assets (NETSDK1004) or missing iOS workload (NETSDK1147); no tests ran in those attempts. Disabling platform TFMs enabled the successful runs above. **Inherited evidence, not reproduced here:** The original combined implementation reportedly passed 472 Graphics.Tests cases (403 existing + 69 new), including CSS cases belonging to the later Markdig layer. New PathBuilderTests/ParseTests reportedly also passed against the old implementation. Old vs new PathBuilder reportedly matched on 300,000 generated paths, including exception type/message in approximately 208,000 throwing cases, using a temporary uncommitted harness. This sampling does not cover the public null exception change or prove all malformed inputs equivalent. Original test/harness commands were not supplied. No benchmarks, differential harness, or external dependency compatibility validation rerun by this session. CI results have not been evaluated. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> None — performance and cleanup work, no tracking issue yet. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `cf57bdcbc1252842694ac16b2fde1fe5016c2811` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8/10 | ↑ 1,407 Core tests and 67 focused Controls tests pass on this head; .NET 11 iOS and overridden Android builds compile.<br>↑ Parent/head benchmarks demonstrate allocation reductions on the identical pre-rebase patch.<br>↓ Intended .NET 12 mobile builds and device behavior remain unverified; external package compatibility and application-level performance need evaluation. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is coordinated .NET 12 stacked work, based on #40778 (Markdig), above #40776 (Graphics) and #40775 (framework prerequisite). #40608 (XamlC removal) is now merged. ### Description of Change <!-- Enter description of the fix in this section --> Reduce allocations in Core event dispatch, converters, font handling and Flex ordering. This layer derives from `add9b583732112c414b3ba410fd10d8ff92396a4`, with adjustments for upstream easing and layout changes. - Use a pooled WeakEventManager dispatch snapshot and in-place dead-subscriber cleanup. **MethodInfo.Invoke is retained**, so handler exceptions remain wrapped in `TargetInvocationException`. Tests cover subscribe/unsubscribe during raises, dead-subscriber cleanup and throwing handlers. - Reduce temporary strings in CornerRadius, Thickness, SafeAreaEdges, Easing and Keyboard converters and font handling. Easing keeps the upstream parser for function/CSS syntax and adds a fast path for named curves. - Reduce ordered-child Flex allocations while preserving stable ordering. Upstream Flex wrap-line and Grid changes are retained; this layer does not independently implement the earlier Grid optimization. - Add converter, event, font and Flex ordering tests and three benchmark fixtures. **Compatibility risk:** prerequisite #40775 removes MAUI netstandard reference targets. On this head, a `netstandard2.0` or `netstandard2.1` project directly referencing Core fails restore with NU1201; the same probe targeting `net12.0` restores. This demonstrates a direct-reference break, not a failure of all netstandard dependencies. NuGet package consumers, external dependencies and migration paths need broader discussion and validation before merge. #### Benchmark data BenchmarkDotNet Release, `--job short --inProcess`, Apple M5 Max, .NET 12.0.0 (12.0.26.55201). These measurements compare the **previous** parent `c63116a21367f2636942ecfafaddf93939dd4600` with head `36c0aad8bcd8f27fff4e27c328c4192d758b790c`, not the current rebased head. The layer patch and benchmarked source files are unchanged by the latest rebase. Each run had three warmups and three measurements; process-priority elevation was denied. Timings are noisy; allocations are the more reliable signal. | Operation | Mean parent | Mean head | Allocated parent | Allocated head | |---|---:|---:|---:|---:| | **WeakEventManager raise, no handlers** | **6.00 ns** | **0.334 ns** | **64 B** | **0 B** | | **WeakEventManager raise, 1 handler** | **38.47 ns** | **30.07 ns** | **192 B** | **40 B** | | **WeakEventManager raise, 5 handlers** | **148.91 ns** | **98.77 ns** | **504 B** | **40 B** | | `Thickness` from XAML string | 81.19 ns | 75.33 ns | 232 B | 48 B | | `Thickness` from CSS string | 73.32 ns | 65.09 ns | 192 B | 48 B | | `Thickness` to string | 140.01 ns | 111.38 ns | 200 B | 96 B | | `CornerRadius` from XAML string | 81.03 ns | 64.16 ns | 208 B | 56 B | | `CornerRadius` to string | 124.17 ns | 108.15 ns | 200 B | 104 B | | `SafeAreaEdges` from string | 73.09 ns | 35.23 ns | 384 B | 32 B | | `Easing` from string | 21.69 ns | 4.26 ns | 48 B | 0 B | | **`Keyboard` from string** | **84.93 ns** | **4.13 ns** | **256 B** | **0 B** | | Flex with ordered children | 1,046.5 ns | 742.9 ns | 1,056 B | 184 B | | Flex wrap with AlignContent | 643.8 ns | 634.6 ns | 264 B | 240 B | | Grid with collapsed children | 543.6 ns | 516.0 ns | 1,384 B | 1,384 B | The Flex-wrap and Grid rows are context, not claims of separate wrap-line or Grid optimizations in this layer. <details> <summary>Historical measurements from the original combined source branch</summary> BenchmarkDotNet Release, `--job short --inProcess`, Apple Silicon; exact runtime version was not preserved. These pre-rebase results are not measurements of the current PR delta. In particular, upstream has since incorporated the earlier Flex-wrap and Grid work. | Operation | Mean before | Mean after | Allocated before | Allocated after | |---|---:|---:|---:|---:| | **WeakEventManager raise, no handlers** | **5.5 ns** | **0.4 ns** | **64 B** | **0 B** | | **WeakEventManager raise, 1 handler** | **36.8 ns** | **33.2 ns** | **192 B** | **40 B** | | **WeakEventManager raise, 5 handlers** | **138.6 ns** | **122.6 ns** | **504 B** | **40 B** | | `Thickness` from XAML string | 109 ns | 80 ns | 232 B | 48 B | | `Thickness` from CSS string | 90 ns | 71 ns | 192 B | 48 B | | `Thickness` to string | 132 ns | 107 ns | 200 B | 96 B | | `CornerRadius` from XAML string | 94 ns | 77 ns | 208 B | 56 B | | `CornerRadius` to string | 124 ns | 113 ns | 200 B | 104 B | | `SafeAreaEdges` from string | 61 ns | 34 ns | 384 B | 32 B | | `Easing` from string | 23 ns | 4.7 ns | 128 B | 0 B | | **`Keyboard` from string** | **82 ns** | **4.3 ns** | **256 B** | **0 B** | | Flex wrap with AlignContent | 617 ns | 592 ns | 664 B | 192 B | | Flex with ordered children | 941 ns | 744 ns | 1056 B | 184 B | | Grid with collapsed children | 647 ns | 640 ns | 2376 B | 2192 B | </details> #### Validation performed SDK `12.0.100-alpha.1.26551.101`; final head `cf57bdcbc1252842694ac16b2fde1fe5016c2811`: ```sh dotnet build src/Core/tests/UnitTests/Core.UnitTests.csproj -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -v:q # PASS: 0 warnings, 0 errors. LC_ALL=en_US.UTF-8 dotnet artifacts/bin/Core.UnitTests/Debug/net12.0/Microsoft.Maui.UnitTests.dll --no-ansi --progress off --output Minimal # PASS: 1,407 passed, 0 failed. dotnet build src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -v:q # PASS: 0 warnings, 0 errors. LC_ALL=en_US.UTF-8 dotnet artifacts/bin/Controls.Core.UnitTests/Debug/net12.0/Microsoft.Maui.Controls.Core.UnitTests.dll --filter-class 'Microsoft.Maui.Controls.Core.UnitTests.FontUnitTests' --filter-class '*EasingFactoryTests' --no-ansi --progress off --output Minimal # PASS: 67 passed, 0 failed. dotnet build src/Core/src/Core.csproj -f net11.0-ios27.0 -p:IncludePreviousTfms=true -p:IncludePreviousTfmsEssentials=true -p:IncludePreviousTfmsGraphics=true -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=true -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -v:q # PASS: 0 warnings, 0 errors. dotnet build src/Core/src/Core.csproj -f net11.0-android37.0 -p:TargetFrameworks=net11.0-android37.0 -p:IncludePreviousTfms=true -p:IncludePreviousTfmsEssentials=true -p:IncludePreviousTfmsGraphics=true -p:IncludeAndroidTargetFrameworks=true -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -v:q # PASS: 1 Gradle warning about an SDK XML version; 0 errors. Uses an explicit platform-target override. ``` The installed workloads are .NET 11-era. The intended .NET 12 Android and iOS targets were not compiled locally: previous attempts failed with NETSDK1139 and NETSDK1140 respectively. The .NET 11 Android build above uses an overridden Android 37 target, not the repository's normal previous-framework Android target. No mobile device tests or application-level performance validation were run; current CI results have not been inspected. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> N/A: performance-focused stack; no issue-closing reference. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `26c9bd3ae7e055ad1fc75b512b9974cb21ad72df` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8/10 | ↑ Conflict-free rebase onto Core parent cf57bdc; all six commits are patch-identical by range-diff.<br>↑ BuildTasks Debug and Controls net12 Release builds succeeded with 0 warnings/errors; 376 focused tests passed on this head.<br>↑ Previous-head full suite failure identities matched its prior parent: Release 19 and Debug 31.<br>↓ Full suite and parent-baseline comparison were not rerun for this latest rebase.<br>↓ Historical incremental row/column allocations increased from 12.5 KB to 14.84 KB per 100 conversions; benchmarks were not rerun after rebase.<br>↓ Platform validation and post-rebase CI results remain unverified. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is next-major .NET 12 work stacked directly on #40779 (`simonrozsival-net12-core-allocations`), not a servicing fix. Earlier layers are #40778 (Markdig), #40776 (Graphics), and #40775. After #40608 merged into main and the lower stack was synchronized with newer main, this layer was rebased onto parent `cf57bdcbc1252842694ac16b2fde1fe5016c2811`; its tests target `net12.0`. The PR base, stack metadata and ready-for-review state are unchanged. ### Description of Change <!-- Enter description of the fix in this section --> Reduce transient parsing allocations in Controls.Core: binding paths, bindable property names, FontAttributes, point/path collections, VisualElement transforms, Shell URI query separation and route parameter extraction. Brush parsing reuses separator arrays and uses spans for selected tokens/numbers, but **BrushTypeConverter still splits strings; this is not a full span-based parser rewrite**. Follow-up cleanup replaces rented string arrays in row/column formatting and LINQ/string.Join in point formatting with indexed StringBuilder loops. Row/column loops share an internal Core `GridLengthTypeConverter.AppendTo` helper using invariant interpolated numeric appends, a separate `*`, and literal `auto`, without per-item strings. Empty and single-grid-item fast paths remain unchanged. FontAttributes returns constant outcomes for the Bold/Italic mask while ignoring unknown bits. Path figures use invariant interpolated coordinate appends, preserving separators/trailing spaces and the existing current-culture formatting of arc sizes/rotation. **This simpler StringBuilder approach increased measured row/column allocations; it is not an allocation improvement for those operations.** Adds focused behavior-preservation tests for binding paths, font attributes, transforms, route parameter names, URI/query handling, and formatter culture/extreme/empty/large-count output. Three benchmark files live in Core.Benchmarks but exercise Controls.Core. The initial layer contained the 19 non-Xaml files from source commit `5d24a694eb3d8de21ead5965d743995ae3a1b1d0`. Follow-up formatter/helper/test changes mean final files no longer exactly match that source. **XamlComponentRegistry optimization is explicitly excluded** from this layer. SourceGen-linked parser files are untouched. #### Benchmark measurements (inherited combined-source run) These measurements were supplied from the earlier combined-source before/after run, **not rerun on this isolated PR and not measurements of the final formatting cleanup or rebased net12 head**. BenchmarkDotNet, Release, `--job short --inProcess`, Apple Silicon. The exact runtime was not preserved; these are **not claimed to be .NET 12 runtime measurements**. Timing means are noisy and error/interval data is unavailable, so small mean differences cannot establish a speedup or regression. These historical allocation reductions do not establish the final layer's allocation profile. | Operation | Mean before | Mean after | Allocated before | Allocated after | |---|---:|---:|---:|---:| | Binding simple | 728 ns | 584 ns | 544 B | 512 B | | Binding nested | 1277 ns | 1146 ns | 1016 B | 968 B | | Binding indexer | 1843 ns | 1877 ns | 1568 B | 1432 B | | VisualElement transform | 342 ns | 290 ns | 688 B | 120 B | | PointCollection | 302 ns | 265 ns | 1304 B | 848 B | | FontAttributes | 45 ns | 28 ns | 176 B | 24 B | | LinearGradientBrush | 5846 ns | 5469 ns | 9344 B | 8968 B | | RadialGradientBrush | 4412 ns | 4252 ns | 6888 B | 6600 B | | PathFigureCollection | 2273 ns | 2176 ns | 3624 B | 3368 B | | BindableProperty | 399 ns | 426 ns | 400 B | 360 B | | Shell ConvertToStandardFormat | 196 ns | 192 ns | 1112 B | 1016 B | | Shell leading `..` | 70 ns | 53 ns | 344 B | 272 B | | Route GetSegmentParameterName | 11.5 ns | 7.7 ns | 72 B | 32 B | | Route mixed parameter | 23.8 ns | 14.0 ns | 72 B | 32 B | | Route template parse | 151 ns | 157 ns | 920 B | 888 B | #### Incremental GridDefinitionBenchmarker comparison Coordinator-supplied measurements compare before `e91ce337a0d7a689a8ed08b3692c7205223528d2` with after `d08fb8f4808bf01b7460df07ce6839740a9cca9a` (both before the rebase). **Each operation performs 100 conversions**; times and allocations below are per 100 conversions, not per conversion. BenchmarkDotNet in-process, Apple M5 Max, .NET 11. The separate before benchmark build failed, so the before run used the after benchmark build with Core and Controls DLLs swapped to the earlier head. This is an incremental cleanup comparison, not an independently rebuilt comparison of the entire stack. It was already run centrally, not rerun by this worker or after the rebase. | Operation (100 conversions) | Mean before | Mean after | Allocated before | Allocated after | |---|---:|---:|---:|---:| | ColumnConvertTo | 6.771 us | 6.621 us | 12.5 KB | 14.84 KB | | RowConvertTo | 6.828 us | 6.235 us | 12.5 KB | 14.84 KB | **Allocated memory increased in both operations.** No clear speedup is inferred from these noisy timing means; error/interval data is unavailable here. #### Validation after latest stack sync Commands executed from repository root at `26c9bd3ae7e055ad1fc75b512b9974cb21ad72df`, on parent `cf57bdcbc1252842694ac16b2fde1fe5016c2811`. Platform TFMs were disabled only through command-line properties. ```sh LC_ALL=en_US.UTF-8 dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --nologo -v:q LC_ALL=en_US.UTF-8 dotnet build src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --nologo -v:q ``` Result: **both passed**, each with 0 warnings and 0 errors. ```sh LC_ALL=en_US.UTF-8 dotnet artifacts/bin/Controls.Core.UnitTests/Release/net12.0/Microsoft.Maui.Controls.Core.UnitTests.dll --parallel none --filter-class '*ColumnDefinitionCollectionTypeConverterUnitTests' '*GridLengthTypeConverterTests' '*FontAttributeConverterUnitTests' '*PathFigureCollectionConverterTests' '*PointCollectionTests' '*BindingExpressionTests' '*ShellRouteTemplatesTests' '*ShellUriHandlerTests' '*VisualElementTests' ``` Result: **passed**, 376 tests, 0 failed, 0 skipped. `git diff --check cf57bdc..HEAD` passed. `git range-diff 36c0aad..779ee7c cf57bdc..HEAD` reported all six commits patch-identical. Rebase was conflict-free. Full-suite Debug/Release runs and a baseline comparison against the latest parent were **not rerun**; the previous evidence below is historical, not a full-suite result on this head. #### Historical validation after previous rebase Commands executed from repository root at `779ee7c046ccd3a68bc90f48d9ce96b3f04dcf9d`. Platform TFMs were disabled only through command-line properties. Upstream migrated the test project to xUnit v3/Microsoft.Testing.Platform, so the test executable is run directly instead of the historical xunit.console v2 runner. ```sh LC_ALL=en_US.UTF-8 dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --nologo -v:q LC_ALL=en_US.UTF-8 dotnet build src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Debug -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --nologo -v:q LC_ALL=en_US.UTF-8 dotnet build src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --nologo -v:q ``` Result: **all passed**, each with 0 warnings and 0 errors. Release was rebuilt again after the parent-baseline comparison. ```sh LC_ALL=en_US.UTF-8 dotnet artifacts/bin/Controls.Core.UnitTests/Release/net12.0/Microsoft.Maui.Controls.Core.UnitTests.dll --parallel none ``` Result: **19 failures**, 7,815 passed, 30 skipped (7,864 total). A fresh Release build/run of the same command on parent `36c0aad8bcd8f27fff4e27c328c4192d758b790c` reproduced the **same exact 19 failure identities**: 18 `CommandsSubscribedToCanExecuteCollect` GC-lifetime cases and `CurrentPageNotNullPoppingRoot(useMaui: True)`. Parent result: 7,716 passed, 19 failed, 30 skipped (7,765 total). These failures were not attributed to this layer; they remain unresolved historical baseline limitations and have not been rechecked against the latest parent. ```sh LC_ALL=en_US.UTF-8 ./artifacts/bin/Controls.Core.UnitTests/Debug/net12.0/Microsoft.Maui.Controls.Core.UnitTests ``` Result: **31 failures**, 7,803 passed, 30 skipped (7,864 total). The same command on a fresh Debug build of parent `36c0aad8bcd8f27fff4e27c328c4192d758b790c`, run back-to-back, gave 31 failures, 7,704 passed, 30 skipped (7,765 total), with **identical failure identities**: the Release 19 plus GC-lifetime leak assertions (`DoesNotLeak`, `LayoutDoesNotLeakAfterChildRemoved`, `RowDefinitionDoesNotLeak`, `TransformGroupTests` subscription leaks and similar) that depend on Debug JIT object lifetimes. They were not attributed to this layer. The historical xunit.console v2 invocation failed to load `xunit.abstractions` after the upstream runner migration and was replaced with the direct v3 executable. ```sh LC_ALL=en_US.UTF-8 dotnet artifacts/bin/Controls.Core.UnitTests/Release/net12.0/Microsoft.Maui.Controls.Core.UnitTests.dll --parallel none --filter-class '*ColumnDefinitionCollectionTypeConverterUnitTests' '*GridLengthTypeConverterTests' '*FontAttributeConverterUnitTests' '*PathFigureCollectionConverterTests' '*PointCollectionTests' '*BindingExpressionTests' '*ShellRouteTemplatesTests' '*ShellUriHandlerTests' '*VisualElementTests' ``` Result: **passed**, 376 tests, 0 failed, 0 skipped. `git diff --check 36c0aad..HEAD` passed on that previous head. Historical pre-rebase evidence: initial split full-suite run passed 6,931 tests with 30 skipped; pre-rebase final formatter run passed 76 tests, and the initial Release benchmark build passed. These are historical results, not latest net12 rebase validation. The older CSS ordering flake was not observed in the serial Release previous-rebase run. Platform/device/UI validation and post-rebase CI investigation have not been performed; no CI success is claimed. Benchmark measurements were not rerun after rebasing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> No bug issue is closed; this is a performance and formatting cleanup layer. Relates to #40779 and the merged #40608. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `f1dfc0cea27b57c5f26e4d62c16df76d650ca3c0` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8.5/10 | ↑ Single-file change; set membership is unchanged because entries are only created by Register/RegisterTemplateComponent and removed by Unregister/GC.<br>↑ Run locally on this head: Controls.Xaml.UnitTests 1652 passed / 3 skipped / 0 failed; SourceGen.UnitTests 999 total / 71 skipped / 0 failed; 41 focused registry/hot-reload Controls.Core tests passed.<br>↓ GetInstances is now O(all registered pages) instead of O(pages of that type), and enumeration order is not formally guaranteed.<br>↓ No benchmark recorded; full Controls.Core.UnitTests, platform TFM builds, device tests and CI not run on this head.<br>↓ Inherited, not rerun here: parent #40780 has 19 full-suite Controls.Core.UnitTests failures that reproduce identically on its Core parent #40779. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change <!-- Enter description of the fix in this section --> **Stack** (bottom → top, on `main` after #40608 merged): #40775 (drop netstandard prerequisite) → #40776 (Graphics) → #40778 (Markdig) → #40779 (Core) → #40780 (Controls.Core) → **this PR (Controls.Xaml)**. Base branch is `simonrozsival-net12-controls-parsing-allocations` (#40780); review only the diff against it. Now that Controls.Xaml no longer targets `netstandard2.0`, `ConditionalWeakTable<TKey,TValue>` is enumerable. The secondary per-type index that existed only to work around that limitation is removed: - Removed `s_instancesByType` (`Dictionary<Type, List<WeakReference<object>>>`) and its lock. - Removed `TrackInstance` / `UntrackInstance` and the `ComponentMap.IsNew` first-registration bookkeeping from `Register` / `RegisterTemplateComponent` / `Unregister`. - `GetInstances(Type)` now enumerates `s_table` directly and returns pages whose `GetType() == pageType`. Single file: `src/Controls/src/Xaml/XamlComponentRegistry.cs` (+5 / −78). **Benchmarks:** none recorded for this change. It is a simplification that removes a global lock, a `WeakReference<object>` allocation and a dead-entry pruning pass from the first registration of each page; no performance numbers are claimed. **Semantic notes / risks:** - **Membership:** unchanged. `s_table` entries are only created by `Register`/`RegisterTemplateComponent` (same triggers that previously called `TrackInstance`) and removed by `Unregister` or GC. - **Type matching:** still exact-type (`GetType() == pageType`), matching the old `page.GetType()` dictionary key; derived types are not returned. - **Ordering:** previously insertion order per type. `ConditionalWeakTable` enumeration is in practice insertion order but not formally documented; callers (hot reload) should not depend on order. - **Cost:** `GetInstances` now scans all registered pages rather than only those of the requested type. It is a hot-reload-only path and the set of live pages is small, but this trades a per-registration cost for a per-lookup scan. - **Thread safety:** `ConditionalWeakTable` enumeration is safe concurrently with adds/removes; entries added or removed during enumeration may or may not be observed, which is equivalent to the old snapshot-under-lock semantics. **Validation** (run locally on head `f1dfc0cea2`, macOS, net12, platform TFMs disabled via `-p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false`): - `dotnet build Microsoft.Maui.BuildTasks.slnf …`, then `Controls.Xaml.UnitTests.csproj`, `SourceGen.UnitTests.csproj`, `Controls.Core.UnitTests.csproj` — passed, 0 errors. - `LC_ALL=en_US.UTF-8 dotnet test src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj --no-build` — **passed**: 1652 passed, 3 skipped, 0 failed. - `dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj --no-build` (includes hot-reload tests) — **passed**: 999 total, 71 skipped, 0 failed. - `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-build --filter "FullyQualifiedName~XamlComponentRegistry|FullyQualifiedName~XamlIncrementalHotReload|FullyQualifiedName~HotReload"` — **passed**: 41 passed, 0 failed. - **Not run on this head:** full Controls.Core.UnitTests, platform TFM builds, device tests, CI. - **Known inherited limitation (from the parent layer, not rerun here):** on parent #40780 the full Controls.Core.UnitTests suite has 19 failures, and the same 19 reproduce identically on its Core parent #40779. This PR does not touch Controls.Core, so they are not expected to change here, but that has not been verified on this head. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes # N/A — part of the net12 netstandard-removal stack. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `6f75ab472d03f5dc70154418240bf2338f098b65` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8/10 | ↑ Both Essentials commits rebased without changes, confirmed by range-diff; review found no substantive issue in traversal checks, coordinate conversion or query decoding.<br>↑ All 550 Essentials tests pass on net12.0; unit-test and Release benchmark builds succeed without warnings.<br>↓ Platform builds and external-consumer compatibility remain unverified; inherited benchmark measurements do not cover the formatting follow-up; CI validation is not complete. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. .NET 12 stack: this layer targets `simonrozsival-net12-simplify-xaml-component-registry` (#40782), rather than duplicating its prerequisite changes against `main`. ### Description of Change <!-- Enter description of the fix in this section --> **Prepared for review following the XamlC removal. Broader discussion and evaluation of external consumers requiring netstandard remain necessary before merging the stack. Essentials is also consumed standalone, so compatibility must be evaluated beyond applications using the full MAUI stack.** Current prerequisite stack, bottom to top: #40775 (drop netstandard) → #40776 (Graphics) → #40778 (Markdig) → #40779 (Core) → #40780 (Controls.Core) → #40782 (Controls.Xaml) → this PR. The former XamlC-removal prerequisite #40608 is now incorporated upstream. This layer's two commits are rebased onto parent `f1dfc0cea27b57c5f26e4d62c16df76d650ca3c0` without patch changes. Use spans for relative-path segment validation, latitude/longitude parsing, and query parameter decoding. Query values containing `+` use a reusable stack buffer up to 256 characters, with a heap buffer for larger values. Format `LocationTypeConverter.ConvertTo` output with `string.Create(CultureInfo.InvariantCulture, ...)`, avoiding two intermediate numeric strings while preserving the exact output and `NotSupportedException` behavior. Add 30 test cases covering traversal segments, malformed coordinates, exact location formatting, invariant culture, invalid conversion values, query decoding and stack-buffer boundaries. TextToSpeech chunking is intentionally skipped: chunks are strings anyway. This layer contains Essentials only, plus its benchmark methods. The six Essentials files are taken from `04fb9f8a715163e48978e576bdf31c8c33d1b488`, plus a follow-up limited to `LocationTypeConverter.ConvertTo` and its tests. The benchmark differs from that source only by omitting the Maps import, field and method. Maps code, Maps tests and `Core.Benchmarks.csproj` are unchanged; Maps follows in a separate layer. **Inherited benchmark measurements — not re-run in this layer, and they do not measure the `ConvertTo` formatting follow-up.** BenchmarkDotNet Release, `--job short --inProcess`, Apple Silicon; measured on the combined Essentials/Maps source. The exact runtime was not preserved, so no runtime version is claimed. Allocations are reliable; timings are noisy short-run measurements, not guaranteed real-world gains. | Operation | Mean before | Mean after | Allocated before | Allocated after | |---|---:|---:|---:|---:| | **`FileSystemUtils.IsValidRelativePath`** | **45.6 ns** | **9.2 ns** | **288 B** | **0 B** | | **`WebUtils.ParseQueryString`** | **229.2 ns** | **183.9 ns** | **1192 B** | **880 B** | | `LocationTypeConverter.ConvertFrom` | 135.2 ns | 99.5 ns | 440 B | 208 B | **Validation re-run at the assessed rebased head:** ```bash dotnet build src/Essentials/test/UnitTests/Essentials.UnitTests.csproj -p:IncludeAndroidTargetFrameworks=false -p:IncludeiOSTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --verbosity quiet ``` Passed: 0 warnings, 0 errors. ```bash LC_ALL=en_US.UTF-8 dotnet test --project src/Essentials/test/UnitTests/Essentials.UnitTests.csproj --no-build -p:IncludeAndroidTargetFrameworks=false -p:IncludeiOSTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false ``` Passed on net12.0/arm64: 550 tests, 0 failed, 0 skipped, including the 30 new cases. Local SDK: `12.0.100-alpha.1.26551.101`. The old xunit.console v2 invocation failed to load `xunit.abstractions`; the parent migrated this test project to xUnit v3/Microsoft.Testing.Platform, so validation now uses its supported `dotnet test` runner. No test failure or source fix was needed. ```bash dotnet build src/Core/tests/Benchmarks/Core.Benchmarks.csproj -c Release -p:IncludeAndroidTargetFrameworks=false -p:IncludeiOSTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false --verbosity quiet git range-diff 2bfe1fa..27de68a f1dfc0c..HEAD git diff --check ``` Passed: Release benchmark build has 0 warnings, 0 errors and no Maps reference; range-diff confirms both commits are unchanged; whitespace check is clean. **Previously run before rebase, not re-run:** ```bash dotnet format Microsoft.Maui.sln --no-restore --include src/Essentials/src/FileSystem/FileSystemUtils.shared.cs src/Essentials/src/Types/LocationTypeConverter.shared.cs src/Essentials/src/Types/Shared/WebUtils.shared.cs src/Essentials/test/UnitTests/FileSystemUtils_Tests.cs src/Essentials/test/UnitTests/LocationTypeConverter_Tests.cs src/Essentials/test/UnitTests/WebUtils_Tests.cs src/Core/tests/Benchmarks/Benchmarks/EssentialsMapsBenchmarker.cs --exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet git diff --stat 04fb9f8 HEAD -- src/Essentials ``` Passed before rebase: formatting completed; the Essentials source comparison contained only the `LocationTypeConverter` follow-up and its tests. The rebase preserved both patches unchanged. Platform builds, external-consumer compatibility and benchmark execution were not run in this layer. CI is not claimed green: Build Insights is in progress; the required `ci-analysis` skill was unavailable for detailed AzDO verification. Ready for human review does not imply ready to merge. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> N/A — performance modernization; no bug issue is claimed fixed. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
… LocProject.json (#40941) <!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `ab54111b12fb8b6b820d0c2be9077c85497cba5c` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 9/10 | ↑ Only the entry for the deleted file is removed.<br>↑ All 15 remaining SourceFile paths verified to exist locally.<br>↓ OneLocBuild not re-run; needs an official dotnet-maui build to confirm. | | Diagnosis confidence | 9.5/10 | ↑ Log reports `SourceFile 'src\Controls\src\Build.Tasks\ErrorMessages.resx' not found`; file is absent on main after #40608. | | Evidence fit | 9/10 | ↑ Failure starts at build 3149209 (77f939a), matching the XamlC removal. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change The official `dotnet-maui` build (dnceng/internal, def 1095) fails on `main` in Localization > OneLocBuild with `SourceFile 'src\Controls\src\Build.Tasks\ErrorMessages.resx' not found` followed by `XLoc failed` ([log](https://dev.azure.com/dnceng/internal/_apis/build/builds/3149209/logs/84)), on every main build since 3149209. #40608 ("Remove XamlC for .NET 12") deleted `src/Controls/src/Build.Tasks/ErrorMessages.resx` and its xlf/lcl files but left the LocItem in `eng/Localize/LocProject.json`. This PR removes that stale entry. Validation: parsed `LocProject.json` and confirmed every remaining `SourceFile` (15 entries) exists in the repo; no other references to the removed resx remain. ### Issues Fixed Part of #40940 (item F1). ### Let AI finish this PR - [x] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.Description of Change
Retire the XamlC IL compiler for .NET 12. SourceGen remains the default; runtime XAML loading remains available.
Microsoft.Maui.Controls.Build.Taskspackage identity for source generators, targets, CodeDom, and optimization profiles, but stop shipping the old task assembly and Cecil. Require all three implicit generators and Resizetizer in in-tree tooling readiness checks; preserve the legacy XamlC assembly check when reviewing servicing branches that still use it.XamlCompilationOptions; update their migration guidance.XamlCinflators withMAUI1004, including case variations and mixed lists. No silent fallback. Runtime XAML remains embedded, without XamlC's validation pass.System.Reflection.Metadata, add inflator-selection/rejection tests, and update migration documentation.Intentional breaking change:
MauiXamlInflator=XamlCandInflator="XamlC"no longer build. Remove these overrides to use SourceGen, or explicitly select Runtime. Compiler-only switches such asMauiXamlCValidateOnlyandMauiKeepXamlResourceshave no effect. The existing runtime binding-diagnostics compatibility switch is retained.Validation after merging main (.NET 12 SDK, host-neutral targets;
.dotnetSDK onPATH):Platform/device builds were not run because the required Apple workloads were unavailable; no UI tests were run.
Previous validation (before merging current main, using its
net11.0transition targets):The unfiltered all-platform prerequisite build could not run locally: the checkout required Apple platform 27.0, while the installed workloads supported 26.5. No device/UI tests were run. Changed C# files were formatted with the repository formatter; PowerShell syntax and
git diff --checkpassed.Issues Fixed
N/A - intentional .NET 12 compiler retirement requested by the maintainer.
Let AI finish this PR