Skip to content

[net10.0] Merge main to net10.0 - #32959

Merged
rmarinho merged 156 commits into
net10.0from
merge-main-net10.0
Dec 3, 2025
Merged

rmarinho merged 156 commits into
net10.0from
merge-main-net10.0

Conversation

@rmarinho

@rmarinho rmarinho commented Dec 2, 2025

Copy link
Copy Markdown
Member

Description of Change

Bring latest changes from main to net10.0 branch

jsuarezruiz and others added 30 commits February 21, 2025 12:50
* Update net10 arcade

* [ci]Don´t bump sdk
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Eliminated the coercion logic that set RadioButton.Value to the instance when null, allowing Value to be explicitly set to null. Updated related unit test to reflect the new behavior.
### Description of Change

This pull request updates key toolchain versions in the pipeline
configuration to ensure the build uses the latest stable releases.

Toolchain version updates:

* Updated the `DOTNET_VERSION` variable to use the stable release
`10.0.100` instead of the previous preview version.

Environment configuration updates:

* Updated `REQUIRED_XCODE` and `DEVICETESTS_REQUIRED_XCODE` variables to
version `26.0.1` to match the current `XCODE` version, ensuring
consistency across build and test environments.
### Description of Change

Helix will push the results so no need to get that task running
StephaneDelcroix and others added 24 commits November 25, 2025 15:53
… correctly (#32843)

* Fix #32836: SourceGen handles typed resources in StaticResource correctly

When Color (or other non-string typed) resources are used with StaticResource
inside markup extensions, they were incorrectly treated as strings causing
CS0030 compilation errors.

The fix recognizes when a resource variable is already properly typed (not
string) and returns it directly without attempting string conversion.

Example that now works:
<Color x:Key="MyColor">#00FF00</Color>
<Label TextColor="{local:MyExtension Source={StaticResource MyColor}}" />

Added comprehensive unit test with full expected code validation.

Fixes #32836

* Add unit tests for issue #32837

- Issue #32837: SourceGen doesn't pass values properly to Converters when using StaticResource
- Added Xaml.UnitTest that validates all three inflators (Runtime, XamlC, SourceGen)
- Added SourceGen.UnitTest for code generation validation
- Tests confirm that the fix for #32836 also resolves #32837
- Both issues had the same root cause: SourceGen not handling typed resources in StaticResource correctly

* Remove unnecessary SourceGen.UnitTest for Maui32837

The Xaml.UnitTest is sufficient to validate the fix across all inflators
Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
…t support (#32733)

* Enable XAML SourceGen by default in templates and add per-file default support

- Add MauiXamlInflator=SourceGen to all template projects
- Add support for Inflator="Default" to revert individual files to config-based defaults
- Add build warning (MAUI1001) when Runtime or XamlC is explicitly set
- Add informational message when SourceGen is enabled
- Include inline documentation in templates explaining usage

Fixes #32732
Fixes #32644

* Update src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Improve warning message clarity per review feedback

- Clarify that 'Runtime' and 'XamlC' are the inflator names
- Fix 'build performance' to 'runtime performance' for Runtime
- Specify that Runtime is only recommended for Debug builds
- Make the message less confusing when XamlC is set

Co-authored-by: Simon Rozsival <simonrozsival@users.noreply.github.com>

* nullability

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Simon Rozsival <simonrozsival@users.noreply.github.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](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!

### Description of Change

Replaces deprecated VisualTestUtils NuGet package (v0.9.46-beta,
unlisted) with vendored source code. Addresses Magick.NET security
advisory CVE-2025-53015 by updating to v13.5.0.

**Changes:**
- Added `VisualTestUtils` project (netstandard2.0) with core visual
regression testing infrastructure
- Added `VisualTestUtils.MagickNet` project with ImageMagick-based image
comparison implementations
- Updated 4 test projects (Android, iOS, Mac, WinUI) to reference local
projects instead of NuGet packages
- Added projects to solution files (Microsoft.Maui.sln,
Microsoft.Maui-dev.sln, Microsoft.Maui-vscode.sln,
Microsoft.Maui-mac.slnf, Microsoft.Maui-windows.slnf)
- Fixed documentation typos in source code comments

**Rationale:** Full control over maintenance and security updates,
eliminates external dependency on unlisted package.

**Note on `UseLocalVisualTestUtils` condition:** The condition in test
project files is intentional. When not set (default), it uses the
vendored VisualTestUtils in the MAUI repo. When set, it allows
developers to reference an external checkout of visual-test-utils for
development purposes.

### Issues Fixed

Fixes #31984

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> Can you create a new PR with main as the base branch and just copy all
the changes over from this PR #32591?


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
### Description of Change

Add Appium capabilities to speed up tests.

_NOTE: See comments in code to learn about every added capability._
…32875)

Reenable test since linked issue has been resolved
<!-- 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!

## Description

Adds Git workflow instructions for Copilot CLI to the repository
instructions (`.github/copilot-instructions.md`).

### Rules added:

1. **Never commit directly to `main`** - Always create a feature branch
2. **No rebase, squash, or force-push** unless explicitly requested by
the user
3. **Ask before pushing when amending an existing PR** - Exception:
proceed if pushing is explicitly part of the instructions

These rules help prevent accidental history rewrites and ensure users
can review changes before they are pushed to remote.
…32870)

- Refactor XamlGenerator to reduce allocations
- Simplify InitializeComponentCodeWriter
- Remove unused tracking name
- Add XTypeMultiFileHotReloadTests for multi-file hot reload scenarios

Performance: ~3% improvement in XamlGenerator build time (1232ms → 1196ms mean)
* Initial plan

* Fix Style setter with attached property content syntax in SourceGen

When using content property syntax for Setter values like:
  <Setter Property="AbsoluteLayout.LayoutBounds">10,10,20,20</Setter>

The source generator was producing invalid code:
  .Value = "10,10,20,20";
  var setter = new Setter {...};

The fix adds the content property name to SkipProperties when the value
is specified as a collection item, preventing SetPropertiesVisitor from
trying to process it separately with an empty variable name.

Fixes #32879

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Format code according to repository standards

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Add SourceGen unit tests for issue #32879

Added Maui32879Tests.cs with two tests:
- StyleSetterWithAttachedPropertyContentSyntax: Tests the fixed issue where
  using content property syntax like <Setter Property="...">value</Setter>
  previously generated invalid C# code
- StyleSetterWithAttachedPropertyAttributeSyntax: Tests that the normal
  attribute syntax still works correctly

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Address PR feedback: remove debug logging in SourceGen tests

- Remove Console.WriteLine debug statements
- Simplify asserts inline with result.Diagnostics

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Convert SourceGen test to snapshot test with expected output

Transform Maui32879Tests to use the snapshot test pattern to clearly show
the expected generated C# code. This makes it easy to verify that the
Setter is properly generated inline without the invalid `.Value = ...`
dead code line.

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
… source generators (#32597)

* Initial plan

* Implement heuristic for source-generated bindable properties

- Add HasBindablePropertyHeuristic method to detect properties/fields with BindablePropertyAttribute
- Modify SetPropertyHelpers to use heuristic when BindableProperty field not found
- Add 5 comprehensive unit tests covering various scenarios
- All 58 tests passing

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Refactor heuristic code and add AutoPropertyAttribute support

- Extract helper methods DerivePotentialPropertyNames and DerivePotentialFieldNames for better readability
- Add support for AutoPropertyAttribute with optional PropertyName parameter
- Refactor IsBindingBaseNode to share code with CanSetBinding
- Add 2 new tests for AutoPropertyAttribute support
- All 60 tests passing

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Add PropertyName support to BindablePropertyAttribute and consolidate tests

- Add PropertyName parameter support to BindablePropertyAttribute (matching AutoPropertyAttribute)
- Refactor tests to use Theory with InlineData for comprehensive coverage
- Consolidate 7 separate tests into 1 parameterized test + 3 edge case tests
- Verify generated SetBinding calls use correct property field names
- All 62 tests passing (53 original + 9 new)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Split tests and merge duplicate attribute checks

- Split Theory test into separate tests for properties and fields for better clarity
- Merge duplicate if statements for BindablePropertyAttribute and AutoPropertyAttribute checks
- All 64 tests passing (53 original + 11 new)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Improve test attribute declarations and add field name variations

- Always declare PropertyName as string? in attribute definitions
- Add parameter to test field name variations (_balance, balance)
- All 66 tests passing (53 original + 13 new)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Add guard conditions and support uppercase field names

- Add null/empty checks to DerivePotentialPropertyNames and DerivePotentialFieldNames to prevent IndexOutOfRangeException
- Support field names with uppercase first letter (uncommon but now supported)
- All 66 tests passing

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Use SetValue for literal values with heuristic-detected bindable properties

- Modified heuristic logic to handle both BindingBase and literal values
- Added SetValueWithHeuristic method to generate SetValue calls
- Updated test to verify SetValue is used instead of property setter
- Added test to ensure property setter is still used when no attribute present
- All 67 tests passing (53 original + 14 heuristic tests)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Move heuristic check to correct position in evaluation order

- Heuristic now evaluated after BP checks but before property setter
- Ensures source-generated BPs use SetBinding/SetValue instead of setter
- Prevents heuristic from being applied too early
- All 67 tests passing

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Check full attribute names instead of suffixes for better specificity

- Replace suffix matching with full name checking
- Support recognized attributes: CommunityToolkit.Maui, SQuan.Helpers.Maui.Mvvm, Maui.BindableProperty.Generator.Core
- Add flexible suffix matching for other libraries (e.g., Test.BindablePropertyAttribute)
- All 67 tests passing (53 original + 14 heuristic tests)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Remove suffix fallback for attribute matching

- Only check exact full attribute names from the recognized list
- Add Test.BindablePropertyAttribute and Test.AutoPropertyAttribute for unit tests
- All 67 tests passing (53 original + 14 heuristic tests)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Integrate heuristic into CanSetBinding and CanSetValue methods

- Move heuristic logic from separate block in SetPropertyValue into Can* methods
- CanSetBinding now checks heuristic when BP is null and value is BindingBase
- CanSetValue now checks heuristic when BP is null and value is not BindingBase
- SetPropertyValue structure unchanged - still just calls Can* methods
- SetBinding and SetValue methods updated to handle heuristic case
- All existing tests passing

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Refactor code to reduce duplication and use real attribute namespaces in tests

- Remove IsBindingBaseNode method - inline the check in CanSetBinding
- Simplify SetBinding and SetValue to reduce duplication using ternary expressions
- Replace Test.BindablePropertyAttribute with CommunityToolkit.Maui.BindablePropertyAttribute in tests
- Replace Test.AutoPropertyAttribute with Maui.BindableProperty.Generator.Core.AutoBindableAttribute in tests
- Update recognized attributes list to remove Test.* entries
- All 67 tests passing

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Fix build error and heuristic logic placement

- Fix null reference error on line 320 (use bpName instead of bpFieldSymbol.ToFQDisplayString())
- Move heuristic check in CanSetValue from inside if(bpFieldSymbol != null) to else block
- Add null/empty check for localName in CanSetBinding heuristic
- Update tests to use real namespace attributes (CommunityToolkit.Maui, Maui.BindableProperty.Generator.Core)

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Fix tests to use proper C# block syntax and non-partial properties

- Changed tests to use block-style namespace syntax instead of file-scoped
- Changed BalanceView from partial class with partial properties to regular class
- Removed partial keyword from properties since that requires C# 13 implementation
- All 14 BindablePropertyHeuristic tests pass
- All 100 SourceGen.UnitTests pass
- All 1746 Xaml.UnitTests pass

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Fixes #24472

When processing XAML with complex nested structures (e.g., CollectionView
with x:Array items and DataTemplate), XamlC could throw 'Value cannot be
null. (Parameter 'key')' because CanAddToResourceDictionary was called
with a null parent parameter.

The fix adds an early null check in CanAddToResourceDictionary to return
false if parent is null, allowing the compiler to try other property-setting
methods instead of crashing.

Added unit test Maui24472 to verify XAML with CollectionView, x:Array,
and DataTemplate compiles correctly.
* Add NullExtension shortcut to SourceGen

Add a shortcut for x:Null markup extension in the source generator,
similar to existing shortcuts for StaticExtension, TypeExtension, etc.

This allows the source generator to directly emit 'null' instead of
instantiating the NullExtension class at runtime.

* Add #pragma warning disable CS0219 to generated code

When diagnostics are disabled (Release mode), variables created for markup
extensions like x:Null may not be used if RegisterSourceInfo is skipped.
This suppresses the 'variable is assigned but never used' warning.

Also updated test expectations to include the new pragma line.

* Add tests for x:Null markup extension shortcut

- Added XNullExtension.cs with two tests verifying:
  1. x:Null in ResourceDictionary generates (object)null! literal
  2. x:Null in DataTrigger Value generates (object)null! literal

code may cast the null value to non-nullable types (e.g., (object)nullExtension),
which would cause CS8600 warnings without the operator.

* Apply suggestion from @StephaneDelcroix

* Apply suggestion from @StephaneDelcroix
Fixes #29422

When a property element (e.g., <Button.Text>) has attributes, the XAML compiler now logs a warning instead of throwing an error. This maintains backward compatibility with existing XAML that may have unnecessary but harmless attributes on property elements.
…#32925)

* Initial plan

* Add RelativeSourceExtension support to XSG for FindAncestorBindingContext mode

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Address code review feedback for improved error messages and simplified test

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

* Add SourceGen.UnitTests for RelativeSource bindings to ensure no XamlTypeResolver usage

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Removed dependency on @azure/openai and replaced OpenAIClient usage with fetch API for chat completions.
Lowered quickScore threshold and increased candidate limit for AI analysis. Adjusted finalScore threshold to catch more potential matches.
# Conflicts:
#	NuGet.config
#	global.json
@rmarinho rmarinho added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Dec 2, 2025
Copilot AI review requested due to automatic review settings December 2, 2025 13:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR merges the latest changes from the main branch into the net10.0 branch, primarily updating solution file references and adding new automation infrastructure for issue reproduction and testing.

Key Changes:

  • Solution file format migration (.slnx → .sln)
  • New GitHub Actions workflow for AI-powered similar issue detection
  • New PowerShell scripts for automated Sandbox and HostApp testing with Appium
  • Agent prompt definitions for PR review, sandbox testing, and UI test writing

Reviewed changes

Copilot reviewed 62 out of 615 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Microsoft.Maui.BuildTasks.slnf Updated solution path reference and reordered Graphics.csproj entry
Microsoft.Maui-windows.slnf Changed solution path and reorganized project entries with new VisualTestUtils projects
Microsoft.Maui-vscode.slnf Entire file deleted (82 lines removed)
Microsoft.Maui-vscode.sln New 671-line solution file created to replace .slnf
Microsoft.Maui-mac.slnf Updated solution path and reordered project entries
Microsoft.Maui-dev.slnf Entire file deleted (93 lines removed)
Microsoft.Maui-dev.sln New 755-line comprehensive solution file created
Directory.Build.props Added IncludeCompatibilityProjects configuration with conditional logic
.vscode/settings.json Changed default solution from .slnf to .sln format
.github/workflows/find-similar-issues.yml New 541-line workflow for AI-powered issue similarity detection
.github/workflows/dotnet-format-daily.yml Updated solution file references for formatting
.github/workflows/dotnet-autoformat-pr.yml Updated solution file reference in autoformat script
.github/scripts/templates/RunWithAppiumTest.template.cs New 276-line Appium test template for issue reproduction
.github/scripts/shared/shared-utils.ps1 New 30-line utility functions for test scripts
.github/scripts/shared/Start-Emulator.ps1 New 285-line script for emulator/simulator management
.github/scripts/shared/Build-AndDeploy.ps1 New 181-line script for building and deploying MAUI apps
.github/scripts/BuildAndRunSandbox.ps1 New 449-line automated Sandbox testing script
.github/scripts/BuildAndRunHostApp.ps1 New 327-line automated HostApp UI testing script
.github/prompts/pr-reviewer.prompt.md File deleted (62 lines removed)
.github/prompts/maui-uitest-write.prompt.md New 95-line prompt for UI test creation
.github/prompts/maui-sandbox-test.prompt.md New 83-line prompt for Sandbox PR testing
.github/prompts/maui-pr-reviewer.prompt.md New 83-line prompt for comprehensive PR reviews
.github/instructions/uitests.instructions.md Updated debugging guidance to focus on crash log analysis
.github/instructions/safearea-testing.md Fixed documentation reference path

@rmarinho
rmarinho merged commit 6a05b74 into net10.0 Dec 3, 2025
@rmarinho
rmarinho deleted the merge-main-net10.0 branch December 3, 2025 12:03
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.