From 5980767bb907f3a23fa981858566bd8b6431a39e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 18:03:53 +0000 Subject: [PATCH 1/4] Remove split_fx host mode handling Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com> --- src/native/corehost/fxr/command_line.cpp | 10 ++-------- src/native/corehost/fxr/fx_muxer.cpp | 19 +++++-------------- src/native/corehost/host_interface.h | 6 +----- src/native/corehost/hostpolicy/hostpolicy.cpp | 3 --- 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/native/corehost/fxr/command_line.cpp b/src/native/corehost/fxr/command_line.cpp index b23f6f4bb1677d..7d82df132fc7b8 100644 --- a/src/native/corehost/fxr/command_line.cpp +++ b/src/native/corehost/fxr/command_line.cpp @@ -44,7 +44,7 @@ namespace std::vector known_opts; known_opts.reserve(static_cast(known_options::__last)); known_opts.push_back(known_options::additional_probing_path); - if (for_cli_usage || exec_mode || mode == host_mode_t::split_fx || mode == host_mode_t::apphost) + if (for_cli_usage || exec_mode || mode == host_mode_t::apphost) { known_opts.push_back(known_options::deps_file); known_opts.push_back(known_options::runtime_config); @@ -229,13 +229,7 @@ int command_line::parse_args_for_mode( { int argoff = args_include_running_executable ? 1 : 0; int result; - if (mode == host_mode_t::split_fx) - { - // Invoked as corehost - trace::verbose(_X("--- Executing in split/FX mode...")); - result = parse_args(host_info, argoff, argc, argv, false, mode, new_argoff, app_candidate, opts); - } - else if (mode == host_mode_t::apphost) + if (mode == host_mode_t::apphost) { // Invoked from the application base. trace::verbose(_X("--- Executing in a native executable mode...")); diff --git a/src/native/corehost/fxr/fx_muxer.cpp b/src/native/corehost/fxr/fx_muxer.cpp index 3dbf3de3b1a646..80039720f73edf 100644 --- a/src/native/corehost/fxr/fx_muxer.cpp +++ b/src/native/corehost/fxr/fx_muxer.cpp @@ -377,7 +377,7 @@ namespace if (coreclr_exists_in_dir(host_info.dotnet_root)) { - // Detect between standalone apphost or legacy split mode (specifying --depsfile and --runtimeconfig) + // Detect between standalone apphost and muxer mode pal::string_t deps_in_dotnet_root = host_info.dotnet_root; pal::string_t deps_filename = host_info.get_app_name() + _X(".deps.json"); @@ -390,7 +390,7 @@ namespace // Name of runtimeconfig file; since no path is included here the check is in the current working directory pal::string_t config_in_cwd = host_info.get_app_name() + _X(".runtimeconfig.json"); - return (deps_exists || !pal::file_exists(config_in_cwd)) && pal::file_exists(host_info.app_path) ? host_mode_t::apphost : host_mode_t::split_fx; + return (deps_exists || !pal::file_exists(config_in_cwd)) && pal::file_exists(host_info.app_path) ? host_mode_t::apphost : host_mode_t::muxer; } if (pal::file_exists(host_info.app_path)) @@ -522,19 +522,10 @@ namespace pal::getenv(_X("DOTNET_ADDITIONAL_DEPS"), &additional_deps_serialized); } - // If invoking using FX dotnet.exe, use own directory. - if (mode == host_mode_t::split_fx) + rc = fx_resolver_t::resolve_frameworks_for_app(host_info.dotnet_root, override_settings, app_config, fx_definitions, mode == host_mode_t::muxer ? app_candidate.c_str() : host_info.host_path.c_str()); + if (rc != StatusCode::Success) { - auto fx = new fx_definition_t(app_config.get_frameworks()[0].get_fx_name(), host_info.dotnet_root, pal::string_t(), pal::string_t()); - fx_definitions.push_back(std::unique_ptr(fx)); - } - else - { - rc = fx_resolver_t::resolve_frameworks_for_app(host_info.dotnet_root, override_settings, app_config, fx_definitions, mode == host_mode_t::muxer ? app_candidate.c_str() : host_info.host_path.c_str()); - if (rc != StatusCode::Success) - { - return rc; - } + return rc; } } diff --git a/src/native/corehost/host_interface.h b/src/native/corehost/host_interface.h index f82d22dfceffed..7241eb07f3d4f9 100644 --- a/src/native/corehost/host_interface.h +++ b/src/native/corehost/host_interface.h @@ -16,11 +16,7 @@ enum host_mode_t apphost, // Invoked as .exe from the application base; this is the renamed "apphost.exe". - split_fx, // Invoked as "corehost.exe" for xunit scenarios. Supported for backwards compat for 1.x apps. - // Split FX means, the host is operating like "corerun.exe" in a split location from the application base (CORE_ROOT equivalent), - // but it has its "hostfxr.dll" next to it. - - libhost, // Invoked from a non-exe scenario (e.g. COM Activation or self-hosting native application) + libhost = 4, // Invoked from a non-exe scenario (e.g. COM Activation or self-hosting native application) }; #define _HOST_INTERFACE_PACK 1 diff --git a/src/native/corehost/hostpolicy/hostpolicy.cpp b/src/native/corehost/hostpolicy/hostpolicy.cpp index 165cc092f621b7..9d4761803b97a4 100644 --- a/src/native/corehost/hostpolicy/hostpolicy.cpp +++ b/src/native/corehost/hostpolicy/hostpolicy.cpp @@ -350,9 +350,6 @@ void trace_corehost_init( case host_mode_t::apphost: host_mode_str = _X("apphost"); break; - case host_mode_t::split_fx: - host_mode_str = _X("split_fx"); - break; case host_mode_t::libhost: host_mode_str = _X("libhost"); break; From fc1254169b3e02d7ffb79ceb6f1cc69b832d5de5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 20:40:06 +0000 Subject: [PATCH 2/4] Add tombstone comment for formerly-used split_fx value in host_mode_t Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com> --- src/native/corehost/host_interface.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/native/corehost/host_interface.h b/src/native/corehost/host_interface.h index 7241eb07f3d4f9..341c7e889adaf8 100644 --- a/src/native/corehost/host_interface.h +++ b/src/native/corehost/host_interface.h @@ -16,6 +16,8 @@ enum host_mode_t apphost, // Invoked as .exe from the application base; this is the renamed "apphost.exe". + // split_fx = 3, // Formerly used for split-framework mode; value 3 is reserved/unused + libhost = 4, // Invoked from a non-exe scenario (e.g. COM Activation or self-hosting native application) }; From fdb634c5dd737ab0a8520a518b66fbb2333e2308 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 21:24:43 +0000 Subject: [PATCH 3/4] Remove coreclr_exists_in_dir if block from detect_operating_mode Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com> --- src/native/corehost/fxr/fx_muxer.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/native/corehost/fxr/fx_muxer.cpp b/src/native/corehost/fxr/fx_muxer.cpp index 80039720f73edf..681ba5437a6521 100644 --- a/src/native/corehost/fxr/fx_muxer.cpp +++ b/src/native/corehost/fxr/fx_muxer.cpp @@ -375,27 +375,8 @@ namespace return host_mode_t::apphost; } - if (coreclr_exists_in_dir(host_info.dotnet_root)) - { - // Detect between standalone apphost and muxer mode - - pal::string_t deps_in_dotnet_root = host_info.dotnet_root; - pal::string_t deps_filename = host_info.get_app_name() + _X(".deps.json"); - append_path(&deps_in_dotnet_root, deps_filename.c_str()); - bool deps_exists = pal::file_exists(deps_in_dotnet_root); - - trace::info(_X("Detecting mode... CoreCLR present in dotnet root [%s] and checking if [%s] file present=[%d]"), - host_info.dotnet_root.c_str(), deps_filename.c_str(), deps_exists); - - // Name of runtimeconfig file; since no path is included here the check is in the current working directory - pal::string_t config_in_cwd = host_info.get_app_name() + _X(".runtimeconfig.json"); - - return (deps_exists || !pal::file_exists(config_in_cwd)) && pal::file_exists(host_info.app_path) ? host_mode_t::apphost : host_mode_t::muxer; - } - if (pal::file_exists(host_info.app_path)) { - // Framework-dependent apphost return host_mode_t::apphost; } From 05ee28bd8290c454b4804ca8c899143ddeab1143 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Fri, 24 Jul 2026 14:36:04 -0700 Subject: [PATCH 4/4] Apply suggestion from @elinor-fung --- src/native/corehost/host_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/corehost/host_interface.h b/src/native/corehost/host_interface.h index 341c7e889adaf8..250217dac12c11 100644 --- a/src/native/corehost/host_interface.h +++ b/src/native/corehost/host_interface.h @@ -16,7 +16,7 @@ enum host_mode_t apphost, // Invoked as .exe from the application base; this is the renamed "apphost.exe". - // split_fx = 3, // Formerly used for split-framework mode; value 3 is reserved/unused + // split_fx = 3, // Formerly used for split-framework mode for 1.x apps. libhost = 4, // Invoked from a non-exe scenario (e.g. COM Activation or self-hosting native application) };