Skip to content

Conversation

@rolfbjarne
Copy link
Member

Due to #23898, the build may end up with resources whose LogicalName property
(which is a path relative to the app bundle where the resource in question
would be located inside the app bundle) points to a location outside the app
bundle.

On macOS we correctly detect this and report an error:

The path '../../../../../../../../../Users/rolf/test/bugs/issue2576178/RazorClassLibrary/wwwroot/background.png' would result in a file outside of the app bundle and cannot be used.

But no such thing was reported on Windows.

Additionally, this become a problem in .NET 10 on Windows because we now
process resources in library projects on Windows without a connection to a
Mac, while previously a connection to a Mac would be required to run into this
problem.

So:

  • Fix the check to work on Windows as well.
  • Also make it a warning (and just ignore the file in question) instead of an
    error, to keep the "works-by-luck" behavior of .NET 9.

This works around #23898 while we implement an actual fix.

…e app bundle.

Due to #23898, the build may end up with resources whose LogicalName property
(which is a path relative to the app bundle where the resource in question
would be located inside the app bundle) points to a location outside the app
bundle.

On macOS we correctly detect this and report an error:

> The path '../../../../../../../../../Users/rolf/test/bugs/issue2576178/RazorClassLibrary/wwwroot/background.png' would result in a file outside of the app bundle and cannot be used.

But no such thing was reported on Windows.

Additionally, this become a problem in .NET 10 on Windows because we now
process resources in library projects on Windows without a connection to a
Mac, while previously a connection to a Mac would be required to run into this
problem.

So:

* Fix the check to work on Windows as well.
* Also make it a warning (and just ignore the file in question) instead of an
  error, to keep the "works-by-luck" behavior of .NET 9.

This works around #23898 while we implement an actual fix.
@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
Collaborator

✅ [CI Build #389015c] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #389015c] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
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: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #389015c] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #389015c] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #389015c] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #389015c] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@rolfbjarne rolfbjarne enabled auto-merge (squash) September 26, 2025 18:20
@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #389015c] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #389015c] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #389015c] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 118 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. 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. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. [attempt 2] 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 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 389015c28aacfee9b3a913613f53684f19cc3aaa [PR build]

@rolfbjarne rolfbjarne merged commit 43102b7 into net10.0 Sep 26, 2025
44 of 45 checks passed
@rolfbjarne rolfbjarne deleted the dev/rolf/issue-23898-workaround branch September 26, 2025 20:49
rolfbjarne added a commit that referenced this pull request Sep 26, 2025
… would end up outside the app bundle. (#23920)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants