Skip to content

Remove test-side Resizetizer workaround once dotnet/maui#35575 ships #136

Open

Description

@mattleibow

Context

The library-mode testing pattern (PR #135) requires workarounds in the test project's TestingWorkarounds.targets because MAUI's Resizetizer and Windows PRI tooling don't propagate AdditionalProperties from ProjectReference when invoking targets on referenced projects.

Upstream fix

dotnet/maui#35575 fixes the Resizetizer issue. The fix is a single line: appending %(_ResizetizeCollectItemsProject.AdditionalProperties) to the Properties parameter in the GetMauiItems MSBuild call. The metadata already flows from Include="@(ProjectReference)" — it just wasn't being used.

What to do when the fix ships

Once the MAUI version containing #35575 is released:

  1. Delete the _RemoveImportedAppResizetizerItems target from sample/test/DeviceTestingKitApp.AppTests/TestingWorkarounds.targets
  2. Update docs/articles/testing-with-app-resources.md to remove the Resizetizer workaround from the drop-in targets template
  3. Bump the minimum MAUI version in Directory.Packages.props (or document the minimum version needed)

What remains

The Windows PRI workaround (_FixWindowsPriForAppReference) is still needed — GetPriOutputs has the same issue but is in the Windows App SDK, not Resizetizer. A separate fix/issue is needed for that.

The app-side TestingWorkarounds.targets is always required — it's the mechanism that enables library mode, not a workaround.

Verified locally

Patching the NuGet cache with the 1-line fix and disabling the workaround:

  • Build: 0 errors, 0 warnings ✅
  • Tests: 10/10 pass ✅
  • AdditionalProperties only flows to the specific ProjectReference that has it ✅

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions