Skip to content

[msbuild] Fix Content/BundleResource with PublishFolderType not bundled in multi-RID builds. Fixes #25053.#25065

Open
rolfbjarne wants to merge 1 commit intomainfrom
dev/rolf/issue-25053-content-universal-apps
Open

[msbuild] Fix Content/BundleResource with PublishFolderType not bundled in multi-RID builds. Fixes #25053.#25065
rolfbjarne wants to merge 1 commit intomainfrom
dev/rolf/issue-25053-content-universal-apps

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

In multi-RID (universal) builds, the outer build saves all Content and BundleResource
items to processed-items files, and inner builds remove them. However, items with
PublishFolderType are not actually processed by CollectBundleResources (it skips
them) — they're handled via ResolvedFileToPublish instead. By incorrectly saving
them as processed, the inner builds remove them before they can be added to ResolvedFileToPublish,
so they never end up in the app bundle.

Fix by filtering out items with PublishFolderType when writing the processed-items
files.

Fixes #25053.

…ed in multi-RID builds. Fixes #25053.

In multi-RID (universal) builds, the outer build saves all Content and BundleResource
items to processed-items files, and inner builds remove them. However, items with
PublishFolderType are not actually processed by CollectBundleResources (it skips
them) — they're handled via ResolvedFileToPublish instead. By incorrectly saving
them as processed, the inner builds remove them before they can be added to ResolvedFileToPublish,
so they never end up in the app bundle.

Fix by filtering out items with PublishFolderType when writing the processed-items
files.

Fixes #25053.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a multi-RID (universal) build bug in the MSBuild resource pipeline where Content/BundleResource items with PublishFolderType were incorrectly treated as “already processed”, causing inner RID builds to remove them before they could be added to ResolvedFileToPublish (and thus they never reached the app bundle).

Changes:

  • Exclude Content/BundleResource items with PublishFolderType from the outer-build “processed items” lists written for multi-RID builds.
  • Extend the BundleStructure test project with PublishFolderType=Resource test inputs for both Content and BundleResource.
  • Update bundle-contents expectations to validate the new resources are present.

Reviewed changes

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

Show a summary per file
File Description
msbuild/Xamarin.Shared/Xamarin.Shared.targets Filters out PublishFolderType items when persisting processed-items lists, preventing inner builds from removing publish-handled assets.
tests/dotnet/BundleStructure/shared.csproj Adds ContentJ/BundleResourceJ items using PublishFolderType=Resource to cover the scenario from #25053.
tests/dotnet/UnitTests/BundleStructureTest.cs Asserts the new ContentJ.txt and BundleResourceJ.txt resources appear in the expected app bundle contents.
tests/dotnet/BundleStructure/ContentJ.txt New test input file for Content + PublishFolderType=Resource.
tests/dotnet/BundleStructure/BundleResourceJ.txt New test input file for BundleResource + PublishFolderType=Resource.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #61c4183] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 61c41837a8dc9b2bb766e4ecb282c51b5850ac24 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #61c4183] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 61c41837a8dc9b2bb766e4ecb282c51b5850ac24 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 61c41837a8dc9b2bb766e4ecb282c51b5850ac24 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #61c4183] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 61c41837a8dc9b2bb766e4ecb282c51b5850ac24 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 [CI Build #61c4183] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 0 tests failed, 151 tests passed.

Failures

❌ Tests on macOS Tahoe (26) tests

🔥 Failed catastrophically on VSTS: test results - mac_tahoe (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. [attempt 6] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 61c41837a8dc9b2bb766e4ecb282c51b5850ac24 [PR build]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content + PublishFolderType do not copy file in the app bundle in Release configuration

6 participants