Skip to content

Fix Resizetizer System.Memory compatibility for SVG filters and text - #39342

Merged
kubaflo merged 3 commits into
dotnet:inflight/currentfrom
sheiksyedm:fix/resizetizer-svg-memory-compatibility
Oct 14, 2026
Merged

kubaflo merged 3 commits into
dotnet:inflight/currentfrom
sheiksyedm:fix/resizetizer-svg-memory-compatibility

Conversation

@sheiksyedm

Copy link
Copy Markdown
Contributor

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!

Description of Change

Fixes build-time SVG rendering failures in Resizetizer following the dependency updates in #37731. Affected SVGs containing filters or text can fail with MissingMethodException, including calls to SKImageFilter.CreateMatrixConvolution and SKTypeface.Clone.

Root cause

Resizetizer bundles the net462 SkiaSharp/HarfBuzzSharp assemblies to retain their native-library loading support for full-framework MSBuild, together with the netstandard2.0 System.Memory assembly used by Svg.Skia.

In System.Memory 4.6.3, these framework assets have different assembly identities:

  • net462: assembly version 4.0.5.0.
  • netstandard2.0: assembly version 4.0.2.0.

The rendering assemblies reference a different System.Memory identity from the bundled asset. This causes incompatible binding of span-based method signatures in MSBuild. The reported SkiaSharp overloads exist; the failure is in method binding, not a missing implementation.

Fix

  • Reuse AdjustReferencedAssemblyVersion to align the System.Memory references in SkiaSharp, SkiaSharp.HarfBuzz, and HarfBuzzSharp with the bundled System.Memory assembly.
  • Package the adjusted copies from the intermediate output directory without modifying the original NuGet-cache assemblies.
  • Preserve the existing net462 native loaders and bundled netstandard2.0 System.Memory asset.
  • Add incremental build inputs/outputs and cleanup tracking.
  • Document when the adjustment can safely be removed after future dependency updates.

This addresses the compatibility mismatch without removing SVG filters or requiring users to replace their artwork.

Regression coverage and validation

Added PackagedResizetizerRendersSvgFiltersAndText, covering Android/iOS images and app icons using an SVG containing Gaussian blur and text. It invokes the packaged Resizetizer task in a separate MSBuild process to exercise the bundled dependencies rather than the test host's asset selection.

Issues Fixed

Fixes #38319

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39342

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39342"

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 12, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟡 Changes recommended

The adjustment task can leave outputs missing or stale when no reference rewrite is required.

1 open finding
What changed in this PR

Fixes Resizetizer SVG filter/text failures caused by mismatched System.Memory assembly identities.

Changes:

  • Rewrites SkiaSharp/HarfBuzzSharp references during packaging.
  • Packages adjusted assemblies with incremental cleanup tracking.
  • Adds packaged-task regression coverage for Android and iOS.
File Description
ResizetizerTests.cs Adds SVG rendering regression tests.
ResizetizerPackages.projitems Packages adjusted rendering assemblies.
Resizetizer.csproj Generates System.Memory-compatible assemblies.

🧠 Review effort: Balanced

@sheiksyedm
sheiksyedm marked this pull request as ready for review October 13, 2026 13:16
Copilot AI balanced review requested due to automatic review settings October 13, 2026 13:16
@sheiksyedm

Copy link
Copy Markdown
Contributor Author

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

🔵 Needs a closer look

The regression test does not cover the explicitly required Windows full-framework MSBuild host.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Add Windows full-framework MSBuild coverage to regression test

src/​TestUtils/​src/​Microsoft.Maui.IntegrationTests/​ResizetizerTests.cs:56

This regression test only calls DotnetInternal.Build, which always runs the repo-local dotnet executable (Utilities/DotnetInternal.cs:9-10,85). It therefore never validates Windows full-framework MSBuild, even though the new compatibility contract explicitly requires both hosts before this adjustment can be considered safe. Please add a Windows lane/invocation using full-framework MSBuild.exe for this packaged task, while retaining this dotnet case.

🧠 Review effort: Balanced

github-actions[bot]

This comment was marked as outdated.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review gate started

AzDO build 15668459 is running for android.

The s/agent-review-in-progress label stays on this PR while existing PR tests are verified. The final gate report contains test evidence only: no expert review, alternative fixes, or Deep UI sweep runs.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 13, 2026 15:24

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.

🔵 Needs a closer look

The regression coverage does not exercise the documented Windows full-framework MSBuild compatibility requirement.

0 open findings

Previously missed (1)

In code that hasn't changed since last review

Medium severity Add Windows full-framework MSBuild coverage to regression test

src/​TestUtils/​src/​Microsoft.Maui.IntegrationTests/​ResizetizerTests.cs:63

This regression test always calls DotnetInternal.Build, which launches the repo-local dotnet executable, so it never exercises Windows full-framework MSBuild.exe. That leaves the explicitly documented full-framework compatibility requirement unprotected; add a Windows full-framework invocation/lane for this packaged-task scenario while retaining the dotnet cases.

🧠 Review effort: Balanced

github-actions[bot]

This comment was marked as outdated.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15682284 is running for android.

The s/agent-review-in-progress label stays on this PR through the full pipeline. The final AI Summary and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

github-actions[bot]

This comment was marked as outdated.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI Review Summary

@sheiksyedm — new AI review results are available based on commit a00285e.

Gate No Tests Confidence Low Platform Android


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ SKIPPED

No tests were detected in this PR.

Recommendation: Add tests to verify the fix using the write-tests-agent.


📋 Pre-Flight — Context & Validation

Pre-Flight Context

Snapshot: PR #39342 is open against main, with immutable submitted head a00285e7edabe996a6785d6626cb3992e3b04601 and base 55c13777e63b59463a5308e245455996b15b297f. It contains three commits and changes three files (+98/-3). GitHub reports the merge state as blocked, but the specific blocker is unknown from the gathered context.

Reported problem

  • #38319 reports a regression beginning with .NET MAUI 10.0.101 after #37731 upgraded SkiaSharp, HarfBuzzSharp, and Svg.Skia. It is verified for Android and remains open under the .NET 10 SR12 milestone.
  • During clean build-time processing of SVG app icons or splash screens containing filters, Resizetizer throws MAUIR0001 with a MissingMethodException for a span-based SKImageFilter.CreateMatrixConvolution overload. Generated icon PNGs are then absent. Cached generated assets can mask the failure.
  • #39165 records the same behavior on iOS in 10.0.101 and 10.0.110 and is closed as a duplicate. Reports also mention SVG text and SKTypeface.Clone.
  • The original report characterized the problem as a mismatched Svg.Skia/SkiaSharp API pair. The PR instead attributes it more specifically to assembly identity differences in System.Memory 4.6.3: the packaged net462 rendering assemblies reference version 4.0.5.0, while the bundled netstandard2.0 System.Memory used by Svg.Skia has version 4.0.2.0. This root-cause claim was not independently verified here through assembly inspection.

Changed files and mechanism

File Submitted change
src/SingleProject/Resizetizer/src/Resizetizer.csproj Adds _AdjustSystemMemoryVersion, running before Build and AssignTargetPaths. It copies the net462 SkiaSharp.dll, SkiaSharp.HarfBuzz.dll, and HarfBuzzSharp.dll into $(IntermediateOutputPath)adjustments, then applies the existing AdjustReferencedAssemblyVersion task in place so their System.Memory references match $(PkgSystem_Memory)\lib\netstandard2.0\System.Memory.dll. Inputs, outputs, and FileWrites are declared for incremental build and cleanup behavior.
src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems Redirects the three packaged managed DLL entries from their NuGet-cache net462 paths to the adjusted intermediate copies. Their PDB paths and all platform-native Skia/HarfBuzz assets remain unchanged. The bundled System.Memory continues to be the netstandard2.0 asset.
src/TestUtils/src/Microsoft.Maui.IntegrationTests/ResizetizerTests.cs Adds a Build-category theory that creates an SVG containing Gaussian blur and text, references the packaged Microsoft.Maui.Resizetizer, and invokes its tasks in a separate MSBuild process. Six cases cover ordinary images, app icons, and splash screens across Android and iOS. Assertions require successful execution, at least one PNG, and platform-specific splash artifacts.

The project already had a related _AdjustSkiaSharpVersion target that adjusts Svg.Skia.dll to reference the selected net462 SkiaSharp assembly. The new target extends this packaging-time compatibility approach to System.Memory references without modifying assemblies in the NuGet cache.

A prior review thread noted that AdjustReferencedAssemblyVersion may produce no output when no rewrite is needed, risking missing or stale package files. Commit 5676725e changed the target to copy every source DLL first and then adjust the copy in place. That thread is resolved and outdated relative to the submitted head.

Platform-sensitive paths

  • Requested later validation platform: Android.
  • The reported Android path includes app-icon rendering through ResizetizeImages and adaptive-icon generation. The added splash case invokes GenerateSplashAndroidResources and expects PNG output plus:
    • values/maui_colors.xml
    • drawable/maui_splash_image.xml
    • drawable-v31/maui_splash_image.xml
  • The iOS duplicate and submitted test invoke GenerateSplashStoryboard and expect MauiSplash.storyboard, but iOS is outside the specified later test platform.
  • Although the user-visible failures are Android/iOS build failures, the assembly manipulation is host-sensitive. The package deliberately retains net462 SkiaSharp/HarfBuzzSharp managed assemblies for Windows full-framework MSBuild native loading while combining them with a netstandard2.0 System.Memory assembly.
  • Native libraries for Windows, macOS, Linux, and their architectures are packaged as before; the diff changes only three managed DLL sources.
  • The regression test directly invokes packaged tasks. It does not build a complete Android application or exercise the complete ProcessMauiSplashScreens resource-registration pipeline.

Validation evidence and requirements

  • Gate: ⚠️ SKIPPED on Android because no runnable PR tests were selected. It produced no test-group result and does not verify the fix. The recorded gate used commit 5676725e, while the current submitted head a00285e subsequently added splash coverage. The gate must not be inferred to have run that test.
  • Author-reported evidence: On macOS with .NET SDK 10.0.112, the author reports that separately executing the generated MSBuild projects failed against published Resizetizer 10.0.110 and passed against the rebuilt PR package. Reported outputs were five Android splash PNGs plus XML, three iOS splash PNGs plus storyboard, and successful execution of all four image/icon scenarios. The author also states that the test project compiled.
  • Author-reported limitation: The normal xUnit integration runner was not executed locally because the repository-local SDK was unavailable. The reported before/after results are isolated packaged-task validation, not a full integration-suite pass.

Later Android validation should establish, without relying on cached outputs:

  1. The packaged artifact contains the adjusted managed DLLs and the expected netstandard2.0 System.Memory asset.
  2. A clean Android build using a filter-and-text SVG succeeds for an ordinary image, app icon, and splash screen and produces the expected PNG/XML resources.
  3. The same reproduction fails without the fix or against the known affected package, establishing regression sensitivity rather than only a passing result.
  4. Clean and incremental package/build paths do not omit or reuse stale adjusted DLLs.
  5. A normal Android app build exercises the complete resource-registration path in addition to the direct packaged-task test.
  6. Because the implementation preserves net462 loaders, compatibility should also eventually be checked under Windows full-framework MSBuild as well as dotnet MSBuild, even though Android is the requested device target.

Remaining uncertainties

  • The exact loaded assembly identities and span-method signatures were not independently captured, so the PR’s System.Memory diagnosis remains supported by the mechanism and reports but unconfirmed here.
  • Current-head CI, the separately running expert review, and any later Android validation outcome are unknown.
  • Whether the new target behaves correctly under every clean, incremental, design-time, pack, and _CopyToBuildTasksDir invocation was not executed here.
  • The submitted test checks task success and file existence, not rendered pixel correctness or filter/text appearance.
  • Full Android app-pipeline coverage, Windows full-framework MSBuild behavior, and other host/SDK combinations remain unverified.
  • The unchanged PDB/native-asset pairing with rewritten managed assemblies has not been independently evaluated.
  • Linked reproduction archives were not downloaded or executed.
  • This is bounded pre-flight context from the submitted diff, immutable source, and linked GitHub records—not an exhaustive code review or a review conclusion.

🔬 Code Review — Deep Analysis

Expert PR Evaluation

Independent Assessment

The submitted fix copies the three net462 SkiaSharp/HarfBuzz managed assemblies into the Resizetizer intermediate output, rewrites their System.Memory references to match the bundled netstandard2.0 System.Memory assembly, and packages those adjusted copies. The submitted integration test exercises filter-and-text SVG images, app icons, and splash screens through the packaged task for Android and iOS.

Findings

The single MAUI expert-review fanout completed and persisted a valid empty findings array in inline-findings.json. It found no concrete, validated source defect suitable for an inline finding.

Refinement Decision

No pr-plus-reviewer candidate was created. The refinement threshold was not met because the expert review identified neither an actionable defect nor an unresolved behavioral mechanism backed by source or test evidence.

Validation Evidence

Gate was skipped and selected no tests, so it does not validate the submitted fix. The saved context also records that Gate ran before the current submitted head added splash coverage. Author-reported packaged-task results are useful context but are not independent current-head regression evidence.

Verdict: NEEDS_DISCUSSION

Confidence: low

Summary: The code review found no blocking implementation defect, but the submitted candidate lacks independent current-head validation of the regression test and Android packaging path. The evidence is therefore insufficient to support approval or a merge-readiness claim.


🛠️ Try-Fix — Analysis & Comparison

Alternative generation: not requested

Evidence-first mode intentionally omits routine Try-Fix attempts. This is not a failed
attempt, a completed alternative search, or evidence that alternatives have no value.
The expert review may still produce one evidence-backed PR refinement.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Trusted read-only context consumed
Code Review NEEDS_DISCUSSION (low) 0 errors, 0 warnings; current-head validation remains unknown
Gate ⚠️ SKIPPED Android; no tests selected, so approval is not permitted
Try-Fix not requested Evidence-first mode intentionally omitted alternative generation
Refinement not created No evidence-backed actionable expert finding met the threshold
Report ✅ COMPLETE Raw pr is the sole real candidate

Code Review and Candidate Comparison

The raw submitted pr is the only candidate. The single expert fanout produced no validated inline findings, and therefore supplied no evidence-backed basis for implementing a pr-plus-reviewer refinement. Routine Try-Fix was not requested; this is an intentional omission, not a failed or exhausted alternative search.

The submitted candidate is ranked first by default because no other real candidate exists. That ranking does not establish merge readiness: Gate was skipped without running tests, and no independent current-head validation demonstrates the regression test, adjusted package contents, or Android image/icon/splash path.

Summary

The submitted implementation is coherent with the reported System.Memory assembly-identity mismatch and the expert review found no concrete source defect. Approval is nevertheless vetoed by the skipped Gate and missing independent current-head regression evidence.

Root Cause

The submitted diagnosis is that the retained net462 SkiaSharp/HarfBuzz assemblies reference System.Memory version 4.0.5.0, while Resizetizer bundles the netstandard2.0 System.Memory assembly with version 4.0.2.0. That identity mismatch prevents binding span-based APIs used by filtered SVGs and text even though the target SkiaSharp methods exist.

Fix Quality

The fix preserves the full-framework native-loading behavior, avoids mutating NuGet-cache assemblies, redirects packaging to adjusted intermediate copies, and adds focused packaged-task coverage for Android and iOS. However, the new test and the clean/incremental packaging path were not run by Gate at the submitted head. Current-head Android regression validation is required before the raw PR can be considered demonstrated merge-ready.


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Oct 14, 2026
@kubaflo

kubaflo commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

@kubaflo
kubaflo changed the base branch from main to inflight/current October 14, 2026 15:56
@kubaflo
kubaflo merged commit 61aaa8b into dotnet:inflight/current Oct 14, 2026
158 of 201 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Expert Review

@sheiksyedm — expert-review status is available for commit a00285e.

Expert review: PR closed

⚠️ Merge recommendation: NO. PR is closed.

🔬 Review details

No validated expert review was published.

The /review expert-review workflow could not publish a validated review. This is an automation status notice, not a code or test verdict. The PR is now closed; no inline findings were posted.

kubaflo added a commit that referenced this pull request Oct 14, 2026
…SVG filters and text (#39388)

<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Backport of #39342 from `inflight/current` to `inflight/candidate` for
SR12. **Explicit exception to the template's generic main-only guidance:
the requested backport targets `inflight/candidate`.**

Applies only the final merged source commit
`61aaa8b2fbe6951ba5a7ebb22da65b49b8d4af38` relative to its single parent
`cc8e3495d1e67c9e84964d80671424c4fa9fa39b`. Exactly three files, no
unrelated dependencies or other backports, and no conflict resolution.
The source and backport have identical stable patch ID
`0df7c70d27f87549d83ef040c8e97d4fc80c9b90`.

- Align the bundled SkiaSharp, SkiaSharp.HarfBuzz and HarfBuzzSharp
System.Memory references while retaining the net462 native loaders.
- Package the adjusted copies without changing the original NuGet-cache
assemblies.
- Carry the existing six-case packaged regression test for Android/iOS
SVG images, app icons and splash resources unchanged.

**Validation on Candidate base
`e741040bbd9ed84f5ee9fadab207501e4fa0e0a2`:**

- `git diff --cached --check` - passed before committing.
Binary-inclusive source/backport stable patch IDs match.
- `dotnet /usr/local/share/dotnet/sdk/10.0.100/dotnet.dll build
Microsoft.Maui.BuildTasks.slnf -p:BuildTaskOnlyBuild=true -v:q` -
passed, 0 errors; 3 Gradle Java 8 obsolescence warnings.
- `.dotnet/dotnet pack
src/SingleProject/Resizetizer/src/Resizetizer.csproj --no-restore -c
Debug -p:BuildTaskOnlyBuild=true -v:q` - passed.
- `MAUI_PACKAGE_VERSION=10.0.120-dev .dotnet/dotnet test
src/TestUtils/src/Microsoft.Maui.IntegrationTests/Microsoft.Maui.IntegrationTests.csproj
--filter
'FullyQualifiedName~PackagedResizetizerRendersSvgFiltersAndText'
--logger trx --results-directory
artifacts/integration-tests/resizetizer-backport -v:q` - passed, 6/6, 0
skipped.
- Baseline control: with only the two production project-file changes
removed, the same six packaged cases failed 6/6 with the intended
`MissingMethodException` (`SKTypeface.Clone`), using a fresh isolated
package cache. After restoring/repacking the backport, the same test
command with `--no-restore` passed 6/6 again with another fresh cache.
The tests remain unchanged in every arm.
- `dotnet /usr/local/share/dotnet/sdk/10.0.100/dotnet.dll test
src/SingleProject/Resizetizer/test/UnitTests/Resizetizer.UnitTests.csproj
-v:q` - 573 passed, 20 failed, 2 skipped. The original Candidate
control, using the same command plus `--no-restore --logger trx
--results-directory artifacts/tests/resizetizer-original-candidate`,
produced the exact same 20 failing
`SkiaSharpAppIconToolsTests.Resize.BasicTest` cases and the same counts.
These failures are not introduced by this backport.
- `.dotnet/dotnet format Microsoft.Maui.sln --no-restore --exclude
Templates/src --exclude-diagnostics CA1822 --include
src/TestUtils/src/Microsoft.Maui.IntegrationTests/ResizetizerTests.cs
--verify-no-changes -v:q` - passed.

The integration runner initially stopped because the repo-local SDK was
absent. Provisioned only that SDK via `dotnet
/usr/local/share/dotnet/sdk/10.0.100/dotnet.dll build
src/DotNet/DotNet.csproj
'-t:_DownloadDotNetInstallScript;_InstallDotNet'
-p:InstallWorkloadPacks=false -v:q` (passed), then used the integration
skill's manual test path with the actual locally packed `10.0.120-dev`
package. No tracked SDK/workload pins were changed. Build/test processes
ran without GitHub/Copilot token environment variables.

Windows full-framework MSBuild validation remains for CI; no device, Mac
Catalyst, XCTest or host UI automation was run. CI is pending, not
claimed green.

### 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 #38319

Backport of #39342.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo pushed a commit that referenced this pull request Oct 18, 2026
…39342)

<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Fixes build-time SVG rendering failures in Resizetizer following the
dependency updates in #37731. Affected SVGs containing
filters or text can fail with `MissingMethodException`, including calls
to `SKImageFilter.CreateMatrixConvolution` and `SKTypeface.Clone`.

#### Root cause

Resizetizer bundles the `net462` SkiaSharp/HarfBuzzSharp assemblies to
retain their native-library loading support for full-framework MSBuild,
together with the `netstandard2.0` System.Memory assembly used by
Svg.Skia.

In System.Memory 4.6.3, these framework assets have different assembly
identities:

- `net462`: assembly version `4.0.5.0`.
- `netstandard2.0`: assembly version `4.0.2.0`.

The rendering assemblies reference a different System.Memory identity
from the bundled asset. This causes incompatible binding of span-based
method signatures in MSBuild. The reported SkiaSharp overloads exist;
the failure is in method binding, not a missing implementation.

#### Fix

- Reuse `AdjustReferencedAssemblyVersion` to align the System.Memory
references in SkiaSharp, SkiaSharp.HarfBuzz, and HarfBuzzSharp with the
bundled System.Memory assembly.
- Package the adjusted copies from the intermediate output directory
without modifying the original NuGet-cache assemblies.
- Preserve the existing `net462` native loaders and bundled
`netstandard2.0` System.Memory asset.
- Add incremental build inputs/outputs and cleanup tracking.
- Document when the adjustment can safely be removed after future
dependency updates.

This addresses the compatibility mismatch without removing SVG filters
or requiring users to replace their artwork.

#### Regression coverage and validation

Added `PackagedResizetizerRendersSvgFiltersAndText`, covering
Android/iOS images and app icons using an SVG containing Gaussian blur
and text. It invokes the packaged Resizetizer task in a separate MSBuild
process to exercise the bundled dependencies rather than the test host's
asset selection.


### 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 #38319
kubaflo added a commit that referenced this pull request Oct 18, 2026
…SVG filters and text (#39388)

<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Backport of #39342 from `inflight/current` to `inflight/candidate` for
SR12. **Explicit exception to the template's generic main-only guidance:
the requested backport targets `inflight/candidate`.**

Applies only the final merged source commit
`61aaa8b2fbe6951ba5a7ebb22da65b49b8d4af38` relative to its single parent
`cc8e3495d1e67c9e84964d80671424c4fa9fa39b`. Exactly three files, no
unrelated dependencies or other backports, and no conflict resolution.
The source and backport have identical stable patch ID
`0df7c70d27f87549d83ef040c8e97d4fc80c9b90`.

- Align the bundled SkiaSharp, SkiaSharp.HarfBuzz and HarfBuzzSharp
System.Memory references while retaining the net462 native loaders.
- Package the adjusted copies without changing the original NuGet-cache
assemblies.
- Carry the existing six-case packaged regression test for Android/iOS
SVG images, app icons and splash resources unchanged.

**Validation on Candidate base
`e741040bbd9ed84f5ee9fadab207501e4fa0e0a2`:**

- `git diff --cached --check` - passed before committing.
Binary-inclusive source/backport stable patch IDs match.
- `dotnet /usr/local/share/dotnet/sdk/10.0.100/dotnet.dll build
Microsoft.Maui.BuildTasks.slnf -p:BuildTaskOnlyBuild=true -v:q` -
passed, 0 errors; 3 Gradle Java 8 obsolescence warnings.
- `.dotnet/dotnet pack
src/SingleProject/Resizetizer/src/Resizetizer.csproj --no-restore -c
Debug -p:BuildTaskOnlyBuild=true -v:q` - passed.
- `MAUI_PACKAGE_VERSION=10.0.120-dev .dotnet/dotnet test
src/TestUtils/src/Microsoft.Maui.IntegrationTests/Microsoft.Maui.IntegrationTests.csproj
--filter
'FullyQualifiedName~PackagedResizetizerRendersSvgFiltersAndText'
--logger trx --results-directory
artifacts/integration-tests/resizetizer-backport -v:q` - passed, 6/6, 0
skipped.
- Baseline control: with only the two production project-file changes
removed, the same six packaged cases failed 6/6 with the intended
`MissingMethodException` (`SKTypeface.Clone`), using a fresh isolated
package cache. After restoring/repacking the backport, the same test
command with `--no-restore` passed 6/6 again with another fresh cache.
The tests remain unchanged in every arm.
- `dotnet /usr/local/share/dotnet/sdk/10.0.100/dotnet.dll test
src/SingleProject/Resizetizer/test/UnitTests/Resizetizer.UnitTests.csproj
-v:q` - 573 passed, 20 failed, 2 skipped. The original Candidate
control, using the same command plus `--no-restore --logger trx
--results-directory artifacts/tests/resizetizer-original-candidate`,
produced the exact same 20 failing
`SkiaSharpAppIconToolsTests.Resize.BasicTest` cases and the same counts.
These failures are not introduced by this backport.
- `.dotnet/dotnet format Microsoft.Maui.sln --no-restore --exclude
Templates/src --exclude-diagnostics CA1822 --include
src/TestUtils/src/Microsoft.Maui.IntegrationTests/ResizetizerTests.cs
--verify-no-changes -v:q` - passed.

The integration runner initially stopped because the repo-local SDK was
absent. Provisioned only that SDK via `dotnet
/usr/local/share/dotnet/sdk/10.0.100/dotnet.dll build
src/DotNet/DotNet.csproj
'-t:_DownloadDotNetInstallScript;_InstallDotNet'
-p:InstallWorkloadPacks=false -v:q` (passed), then used the integration
skill's manual test path with the actual locally packed `10.0.120-dev`
package. No tracked SDK/workload pins were changed. Build/test processes
ran without GitHub/Copilot token environment variables.

Windows full-framework MSBuild validation remains for CI; no device, Mac
Catalyst, XCTest or host UI automation was run. CI is pending, not
claimed green.

### 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 #38319

Backport of #39342.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
gasizdat added a commit to gasizdat/GT4 that referenced this pull request Oct 20, 2026
CI and release builds failed on windows-latest once its image moved to
MAUI 10.0.110: that version's Resizetizer throws MissingMethodException
on the SVG text and drop-shadow filter in our app icon and splash
(dotnet/maui#39342, open). MauiVersion came from whatever workload the
runner had, so the break arrived without any change of ours. 10.0.20 is
the workload the app is developed and tested with.
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-resizetizer community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[10.0.101] Resizetizer fails on any SVG app icon containing a <filter>: MissingMethodException SKImageFilter.CreateMatrixConvolution

4 participants