Remove multi-level lookup completely - #132335
Open
elinor-fung wants to merge 3 commits into
Open
Conversation
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the remaining multi-level lookup behavior from the native hosting layer, including the associated helpers, probing of global locations/shared store, and test coverage that was specific to the feature.
Changes:
- Remove multi-level lookup decision logic (TFM-based compat gating,
DOTNET_MULTILEVEL_LOOKUP, and global-dir probing) from corehost resolution paths. - Simplify framework/shared-store probing to only consider the selected
dotnet_root(and other explicit/known locations such as self-registered/default install where applicable). - Delete/adjust installer/host activation tests and docs that asserted or described multi-level lookup behavior.
Show a summary per file
| File | Description |
|---|---|
| src/native/corehost/runtime_config.h | Removes MLL-related API and compat helpers from runtime config. |
| src/native/corehost/runtime_config.cpp | Removes TFM major parsing and MLL-disable logic. |
| src/native/corehost/hostpolicy/shared_store.cpp | Stops probing global shared store locations; keeps env + muxer-relative paths. |
| src/native/corehost/hostmisc/utils.h | Removes MLL helper declarations. |
| src/native/corehost/hostmisc/utils.cpp | Removes DOTNET_MULTILEVEL_LOOKUP parsing and framework-location aggregation. |
| src/native/corehost/hostmisc/pal.windows.cpp | Removes global dotnet dir enumeration for MLL. |
| src/native/corehost/hostmisc/pal.unix.cpp | Removes stub global dotnet dir API (no longer needed). |
| src/native/corehost/hostmisc/pal.h | Removes get_global_dotnet_dirs from PAL surface. |
| src/native/corehost/hostfxr.h | Updates API docs to no longer describe multi-level lookup ordering/behavior. |
| src/native/corehost/fxr/sdk_info.cpp | Updates comments to reflect tie-breaking for custom search locations rather than MLL. |
| src/native/corehost/fxr/hostfxr.cpp | Adds empty-dotnet_root validation for startupinfo entrypoints; adjusts framework enumeration call signature. |
| src/native/corehost/fxr/fx_resolver.messages.cpp | Removes MLL parameter plumbing when collecting framework infos for diagnostics. |
| src/native/corehost/fxr/fx_resolver.h | Removes MLL state/parameter from resolver type and error display helper signature. |
| src/native/corehost/fxr/fx_resolver.cpp | Removes multi-hive framework probing; resolves frameworks from the selected dotnet_root only. |
| src/native/corehost/fxr/framework_info.h | Removes hive depth tracking and MLL parameter from framework enumeration API. |
| src/native/corehost/fxr/framework_info.cpp | Enumerates frameworks only under <dotnet_root>/shared, without multi-hive ordering. |
| src/installer/tests/TestUtils/DotNetCli.cs | Removes default test opt-out of MLL (no longer applicable). |
| src/installer/tests/TestUtils/Constants.cs | Removes DOTNET_MULTILEVEL_LOOKUP constant. |
| src/installer/tests/TestUtils/CommandExtensions.cs | Removes .MultilevelLookup(...) command helper. |
| src/installer/tests/HostActivation.Tests/SDKLookup.cs | Removes calls to .MultilevelLookup(false). |
| src/installer/tests/HostActivation.Tests/NativeHosting/SharedTestStateBase.cs | Removes .MultilevelLookup(false) usage when constructing native host commands. |
| src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs | Removes .MultilevelLookup(...) usage in nethost tests. |
| src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs | Removes .MultilevelLookup(false) usage. |
| src/installer/tests/HostActivation.Tests/NativeHosting/ComhostSideBySide.cs | Removes .MultilevelLookup(false) usage. |
| src/installer/tests/HostActivation.Tests/InstallLocation.cs | Removes .MultilevelLookup(false) usage. |
| src/installer/tests/HostActivation.Tests/HostVersionCompatibility.cs | Updates comment to remove MLL-specific rationale. |
| src/installer/tests/HostActivation.Tests/FrameworkResolution/MultilevelLookup.cs | Deletes test suite dedicated to multi-level lookup behavior. |
| src/installer/tests/HostActivation.Tests/FrameworkDependentAppLaunch.cs | Removes .MultilevelLookup(false) usage. |
| src/installer/tests/HostActivation.Tests/DependencyResolution/ComponentSharedTestStateBase.cs | Removes .MultilevelLookup(false) usage. |
| src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs | Removes .MultilevelLookup(false) usage. |
| src/installer/tests/AppHost.Bundle.Tests/AppLaunch.cs | Removes .MultilevelLookup(false) usage. |
| docs/design/features/hosting-layer-apis.md | Updates description to remove MLL from SDK resolution doc. |
| docs/design/features/host-probing.md | Removes Windows global-location probing notes tied to MLL/shared store global usage. |
| docs/design/features/host-component-dependencies-resolution.md | Removes MLL references from component dependency resolution design doc. |
Review details
Suppressed comments (1)
src/native/corehost/fxr/hostfxr.cpp:59
- This validation now treats an empty
dotnet_rootas invalid, but the error message only mentions null. Updating the message avoids confusion when callers pass an empty string.
if (host_path == nullptr || dotnet_root == nullptr || app_path == nullptr || dotnet_root[0] == _X('\0'))
{
trace::error(_X("Invalid startup info: host_path, dotnet_root, and app_path should not be null."));
return StatusCode::InvalidArgFailure;
- Files reviewed: 34/34 changed files
- Comments generated: 1
- Review effort level: Lite
This was referenced Aug 14, 2026
AaronRobinsonMSFT
approved these changes
Aug 15, 2026
AaronRobinsonMSFT
left a comment
Member
There was a problem hiding this comment.
![]()
@vitek-karas You better sign off too!
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/native/corehost/hostfxr.h:334
- This comment says "dotnet root directory (if any)" but the implementation treats
dotnet_root == nullptras the signal to use the global default location. Consider tightening the wording here to explicitly call out thatnullptris what triggers the global default behavior, so native hosts don’t misinterpret empty strings as the same thing.
// Resolves the existing SDKs and frameworks from a dotnet root directory (if
// any), or the global default location.
src/native/corehost/fxr/hostfxr.cpp:38
- The validation now rejects an empty
dotnet_root(checksdotnet_root[0] == '\0'), but the error message only mentions null values. This makes failures harder to diagnose since an empty string will report the wrong cause.
if (host_path == nullptr || dotnet_root == nullptr || app_path == nullptr || dotnet_root[0] == _X('\0'))
{
trace::error(_X("Invalid startup info: host_path, dotnet_root, and app_path should not be null."));
return StatusCode::InvalidArgFailure;
}
src/native/corehost/fxr/hostfxr.cpp:60
- Same issue as above: this check now treats an empty
dotnet_rootas invalid, but the error message only mentions null. Update the message so it accurately describes the validation being performed.
if (host_path == nullptr || dotnet_root == nullptr || app_path == nullptr || dotnet_root[0] == _X('\0'))
{
trace::error(_X("Invalid startup info: host_path, dotnet_root, and app_path should not be null."));
return StatusCode::InvalidArgFailure;
}
- Files reviewed: 34/34 changed files
- Comments generated: 0 new
- Review effort level: Lite
AaronRobinsonMSFT
approved these changes
Aug 15, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #131555
cc @dotnet/appmodel @AaronRobinsonMSFT