Add ignore_global_json flag to hostfxr_resolve_sdk2#128169
Open
JoeRobich wants to merge 2 commits into
Open
Conversation
This allows consumers such as the dotnet CLI to ignore global.json when resolving the SDK version to use. This is useful for scenarios where the user wants to use the latest SDK version regardless of what is specified in global.json. fix dotnet#128168
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an ignore_global_json option to hostfxr_resolve_sdk2, allowing SDK resolution to behave as though no global.json was present.
Changes:
- Adds a new SDK resolver factory for default settings.
- Wires a new
ignore_global_jsonflag throughhostfxr_resolve_sdk2. - Adds native host API tests and updates hosting API documentation.
Show a summary per file
| File | Description |
|---|---|
src/native/corehost/fxr/sdk_resolver.h |
Declares a default-settings resolver factory. |
src/native/corehost/fxr/sdk_resolver.cpp |
Implements resolver creation that bypasses global.json. |
src/native/corehost/fxr/hostfxr.cpp |
Adds and applies the new ignore_global_json flag. |
src/installer/tests/HostActivation.Tests/NativeHostApis.cs |
Adds tests for ignoring global.json. |
src/installer/tests/Assets/Projects/HostApiInvokerApp/HostFXR.cs |
Updates test P/Invoke flag enum. |
docs/design/features/hosting-layer-apis.md |
Documents the new flag. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 2
| enum hostfxr_resolve_sdk2_flags_t | ||
| { | ||
| disallow_prerelease = 0x1, | ||
| ignore_global_json = 0x2, |
Contributor
There was a problem hiding this comment.
API review has not been used for native hosting APIs.
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.
This allows consumers such as the dotnet CLI to ignore global.json when
resolving the SDK version to use. This is useful for scenarios where
the user wants to use the latest SDK version regardless of what is
specified in global.json.
fix #128168