Skip to content

Add ApplicationArtifact support for Windows App SDK - #35973

Open
Redth wants to merge 6 commits into
mainfrom
redth/plan-maui-artifacts-net11
Open

Redth wants to merge 6 commits into
mainfrom
redth/plan-maui-artifacts-net11

Conversation

@Redth

@Redth Redth commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 312526123e9b6e3f2d8d4099d7578df6c71de47e

Dimension Assessment Rationale
Change confidence 7.5/10 ↑ 12 targets/fixture tests pass locally on macOS with the .NET 12 SDK.
↑ Targets import only for Windows App SDK TFMs, so Android/Apple builds are unaffected.
↓ Real Windows template build/publish tests run only on Windows CI and have not been inspected for this revision.

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

Adds @(ApplicationArtifact) items for Windows App SDK applications, matching the contract that .NET for Android and .NET for Apple platforms already provide:

The Windows producer ships in Microsoft.Maui.Core's existing buildTransitive targets (WinUI.ApplicationArtifacts.targets, imported next to WinUI.targets). There is no separate NuGet package and no workload change. It could move into the Windows App SDK later.

It defines GetApplicationArtifacts (depends on Build, returns @(ApplicationArtifact), extensible via $(GetApplicationArtifactsDependsOn)) and refreshes items for Publish, so this works:

dotnet build -f net11.0-windows10.0.19041.0 -t:GetApplicationArtifacts -getItem:ApplicationArtifact
dotnet publish -f net11.0-windows10.0.19041.0 -getItem:ApplicationArtifact

It activates only for non-.wapproj Windows App SDK projects with Exe/WinExe output. Set EnableWindowsApplicationArtifacts=false to opt out.

What is reported

Only final application outputs, read from Windows App SDK output properties and item lists (no directory scanning):

Output PackageFormat IsDirectory
Unpackaged build or publish directory directory true
MSIX (including sparse) msix false
Bundle msixbundle false
Store upload msixupload false
App Installer appinstaller false

Legacy appx* formats are handled the same way. Intermediates, dependency framework packages, symbols, certificates and install scripts are not reported.

Metadata: PackageFormat, IsDirectory, Signed, EntryPoint, RuntimeIdentifier, PlatformName=Windows, plus the common ApplicationId, ApplicationName, ApplicationTitle, ApplicationDisplayVersion and ApplicationVersion (from the final Appx manifest when packaged; a.b.c.d maps to display version a.b.c and version d).

Testing

  • dotnet test src/TestUtils/src/Microsoft.Maui.IntegrationTests/Microsoft.Maui.IntegrationTests.csproj --filter "FullyQualifiedName~WindowsApplicationArtifactsTargetsTest|FullyQualifiedName~WindowsTemplateTest.ApplicationArtifacts": passed (12/12) on macOS. Fixture tests cover packaged, sparse, unpackaged build/publish, and inert project shapes.
  • Windows-only template tests (MAUI unpackaged/MSIX build and publish, bundle + store upload + App Installer) run in Windows CI.

Issues Fixed

N/A

@github-actions

This comment has been minimized.

@kubaflo kubaflo 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.

Multi-Model Review — PR #35973

Verdict: ❌ NEEDS_CHANGES
Confidence: High (unanimous across all 4 models)

All 4 models independently identified issues that should be addressed before merging.

Model agreement: gemini (NEEDS_CHANGES/1), gpt-5.5 (NEEDS_CHANGES/1), opus-4.6 (NEEDS_CHANGES/1), opus-4.8 (NEEDS_CHANGES/2)

Findings: 4 unique issues identified.

<ApplicationIdGuid>11111111-2222-3333-4444-555555555555</ApplicationIdGuid>
<ApplicationDisplayVersion>2.3</ApplicationDisplayVersion>
<ApplicationVersion>42</ApplicationVersion>
</PropertyGroup>

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.

The relative path $(MSBuildThisFileDirectory)..\..\..\ assumes the test directory is located within the MAUI repository bin/ folder. However, on Azure Pipelines CI, TestDirectory is located under AGENT_TEMPDIRECTORY (e.g., .../test-dir/ApplicationArtifactsAreEnrichedWithMauiMetadata/). As a result, traversing up 3 directories points to AGENT_TEMPDIRECTORY/src/Workload/... instead of the repository, causing MSB4019 missing import errors and failing the integration tests.

<ApplicationDisplayVersion>2.3</ApplicationDisplayVersion>
<ApplicationVersion>42</ApplicationVersion>
</PropertyGroup>
<Import Project="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\src\Workload\Microsoft.Maui.Sdk\Sdk\Microsoft.Maui.Sdk.After.targets'))" />

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.

This import is rooted at the generated test project's MSBuildThisFileDirectory and walks up three directories to find src/Workload. That happens to work for local fallback TestDirectory under the repo's bin/test-dir, but in Azure Pipelines TestEnvironment.GetTestDirectoryRoot() uses AGENT_TEMPDIRECTORY/test-dir, so ......\src does not point at the MAUI checkout and the new Build integration test cannot import Microsoft.Maui.Sdk.After.targets. The current CI failures in the Build integration lanes are consistent with this PR-introduced test path issue.

(found by: 5, 4)

<Target Name="SeedApplicationArtifacts">
<ItemGroup>
<ApplicationArtifact Include="$(MSBuildProjectDirectory)/artifacts/platform/android/MyArtifactApp-Signed.apk">
<PackageFormat>apk</PackageFormat>

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.

The explicit <Import Project="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\\..\\..\\src\\Workload\\...'))" /> assumes the project directory is 3 levels deep inside the repo root. Locally this resolves from <repo>/bin/test-dir/<testname>/ to <repo>/. In CI, TestDirectory is under $AGENT_TEMPDIRECTORY/test-dir/<testname>/, so 3 parent traversals land in the agent temp directory—not the repo. The targets file won't exist there, causing a build error. This is the likely cause of the CI 'Build integration tests' failures on both macOS and Windows.

Lines="@(ApplicationArtifact->'%(Filename)%(Extension)|%(PackageFormat)|%(ApplicationTitle)|%(ApplicationName)|%(ApplicationId)|%(ApplicationIdGuid)|%(ApplicationDisplayVersion)|%(ApplicationVersion)|%(Signed)|%(PackageId)|%(PlatformName)|%(BundleIdentifier)')"
Overwrite="true" />
</Target>
<Target Name="WritePublishApplicationArtifactsMetadata" DependsOnTargets="SeedApplicationArtifacts;_AddMauiApplicationArtifactMetadata">

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.

Both WriteGetApplicationArtifactsMetadata and WritePublishApplicationArtifactsMetadata depend directly on SeedApplicationArtifacts;_AddMauiApplicationArtifactMetadata, so they exercise the metadata target in isolation rather than through a real GetApplicationArtifacts/Publish invocation; the actual wiring is only checked indirectly by the string Assert.Contains on the depends-on file (line 178). The Publish variant therefore adds no coverage beyond the Get variant. This is understandable while the platform GetApplicationArtifacts target is unavailable in net11, but consider collapsing the duplicate target (or asserting the real wiring) once the platform producers land.

@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.

Expert Review — 2 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jun 19, 2026
MauiBot

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.

Expert Review — 2 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels Jun 19, 2026
MauiBot

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.

Expert Review — 2 findings

See inline comments for details.

MauiBot

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.

Expert Review — 5 findings

See inline comments for details.

MauiBot

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.

Expert Review — 2 findings

See inline comments for details.

MauiBot

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.

Expert Review — 1 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@kubaflo kubaflo removed the s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

MAUI Autopilot · round 1

No code changes were published. The Windows Essentials device-test job failed before tests ran; all three models found both diagnostics unrelated to this PR.

Failure GPT-6.2 Sol MAI Code 2 Claude Opus 5.5 Final verdict Evidence
CS0117: ImageProcessor.RotateImageAsync not found unrelated unrelated unrelated unrelated The stale test call and missing method are both present at the merge base. #40666 already updates the test on main.
WMC0001: MiddleApp not found unrelated unrelated unrelated unrelated App.xaml and MiddleApp are unchanged; this is consistent with the C# compilation failure preventing WinUI from resolving the type.

@github-actions github-actions Bot removed the s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) label Dec 1, 2026
kubaflo added a commit that referenced this pull request Dec 1, 2026
<!-- copilot-assessment:v1 -->
### Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: `c7d2aee904460de8f1689ab1f48d0915b3ba2e3f`

| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 9/10 | ↑ Compiled; changed next_round script
passes `node --check`.<br>↑ Replay: SOURCE=tests with nothing published
now stops; expert/threads/conflicts unchanged.<br>↓ Not yet observed
live. |
| Diagnosis confidence | 9.5/10 | ↑ next_round log for run 46635171157:
"#35973: every thread is answered; the loop continues" with
SOURCE=tests, publish skipped.<br>↑ 27 identical "fix (tests, round 1)"
runs at head 3125261 in 6 h, ~100 "round 1" comments since Nov 27. |
| Evidence fit | 9/10 | ↑ #35973 was ~3.4k of the ~38k AI credits in the
95 measured autopilot runs, all at the same head.<br>↓ Remaining spend
is from genuine expert fix rounds (avg ~510 credits), which this does
not change. |
<!-- /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!

### Description of Change

A tests fix round that decides the failures are unrelated publishes
nothing. `next_round` then re-dispatched the loop ("every thread is
answered"), and `pre_activation` found the same `FAILED` test comment
for the same head and ran the same tests round again, every ~15 minutes,
indefinitely. #35973 did this ~100 times.

- `next_round`: a `tests` round that publishes nothing now stops the
loop (like `conflicts`), with `s/autopilot-needs-maintainer-decision`
and a specific Stopped message.
- Docs: the stage table notes that a tests round that publishes nothing
stops for a maintainer decision.

Validation: `gh aw compile maui-expert-autopilot`; `node --check` on the
changed script; replay of the decision for each source.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates 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.

5 participants