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..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 or legacy split mode (specifying --depsfile and --runtimeconfig) - - 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::split_fx; - } - if (pal::file_exists(host_info.app_path)) { - // Framework-dependent apphost return host_mode_t::apphost; } @@ -522,19 +503,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) - { - 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) { - 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..250217dac12c11 100644 --- a/src/native/corehost/host_interface.h +++ b/src/native/corehost/host_interface.h @@ -16,11 +16,9 @@ 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. + // split_fx = 3, // Formerly used for split-framework mode for 1.x apps. - 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;