Merging internal commits for release/9.0#116499
Merged
hoyosjs merged 9 commits intodotnet:release/9.0from Jun 11, 2025
Merged
Conversation
…rios (COM, C++/CLI, custom component host) could try to load coreclr from CWD There is a fallback for apps with no .deps.json where the host will consider the app directory for loading coreclr. In component hosting scenarios, we do not have an app path / directory. We were incorrectly going down the path of looking for coreclr next to the empty app directory, which resulted in looking in the current directory. This change skips that path for libhost scenarios. It also adds checks that the paths we determine for loading coreclr, hostpolicy, and hostfxr are absolute.
…-merge-9.0-2025-06-10-1320
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR merges internal commits for release/9.0, with the primary aim of enforcing that hosting components are loaded only via absolute paths and expanding tests to ensure that components in the working directory are ignored.
- Added absolute path checks for coreclr, hostfxr, and hostpolicy to prevent loading from non-rooted paths.
- Updated deps_resolver logic to conditionally add paths based on host mode and verify the presence of app deps.
- Added new tests in multiple files to confirm that working directory hosting components are not used.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp | Adds an absolute path check on coreclr path before loading. |
| src/native/corehost/hostpolicy/deps_resolver.cpp | Updates condition to avoid processing in libhost scenarios and asserts a non-empty app directory. |
| src/native/corehost/fxr_resolver.h | Adds an absolute path check on hostfxr path. |
| src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp | Adds an absolute path check on hostpolicy path. |
| src/native/corehost/apphost/standalone/hostfxr_resolver.cpp | Adds an absolute path check for hostfxr in apphost context. |
| src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs | Renames the extension class and adds new fluent assertion extensions for hostfxr, hostpolicy, and coreclr resolution. |
| src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs | Adds a test to verify that hosting components in the working directory are ignored. |
| src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs | Adds a test that validates library loading ignores components from the working directory. |
| src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs | Adds a test to ensure that components from the working directory are not utilized. |
This was referenced Jun 11, 2025
hoyosjs
approved these changes
Jun 11, 2025
Member
|
Merging internal commits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.