Skip to content

Add ignore_global_json flag to hostfxr_resolve_sdk2#128169

Open
JoeRobich wants to merge 2 commits into
dotnet:mainfrom
JoeRobich:add-ignore-global-json-flag
Open

Add ignore_global_json flag to hostfxr_resolve_sdk2#128169
JoeRobich wants to merge 2 commits into
dotnet:mainfrom
JoeRobich:add-ignore-global-json-flag

Conversation

@JoeRobich
Copy link
Copy Markdown
Member

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

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
Copilot AI review requested due to automatic review settings May 13, 2026 21:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_json flag through hostfxr_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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API review has not been used for native hosting APIs.

Comment thread docs/design/features/hosting-layer-apis.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the SDK resolver to ignore the global.json

3 participants