Merging internal commits for release/8.0#116498
Merged
rbhanda merged 7 commits intodotnet:release/8.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-8.0-2025-06-10-1311
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR merges internal commits for release/8.0 and introduces explicit checks to ensure that core libraries (coreclr, hostfxr, hostpolicy) are loaded from absolute paths. Key changes include:
- Adding absolute path validations in multiple native host components.
- Adjusting deps_resolver logic to account for libhost scenarios.
- Introducing new tests that verify hosting components in the working directory are ignored.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp | Added an absolute path check for the coreclr DLL. |
| src/native/corehost/hostpolicy/deps_resolver.cpp | Modified logic to add known paths only for non-libhost cases and added an assertion on the application directory. |
| src/native/corehost/fxr_resolver.h | Introduced an absolute path check for hostfxr. |
| src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp | Added an absolute path check for hostpolicy. |
| src/native/corehost/apphost/standalone/hostfxr_resolver.cpp | Added an absolute path check for hostfxr and updated the status code when the check fails. |
| src/installer/tests/TestUtils/TestArtifact.cs | Added a factory method to create test artifacts with associated deletion paths. |
| src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs | Renamed the extension class and added new methods for resolving hostfxr, hostpolicy, and coreclr. |
| src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs | Added a test to ensure that hosting binaries in the working directory are ignored. |
| src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs | Added a test to validate that components in the working directory are not used. |
| src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs | Added a test to verify that hosting binaries from the working directory are not used during activation. |
This was referenced Jun 11, 2025
hoyosjs
approved these changes
Jun 11, 2025
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.