Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/native/corehost/fxr/command_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace
std::vector<known_options> known_opts;
known_opts.reserve(static_cast<int>(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);
Expand Down Expand Up @@ -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..."));
Expand Down
34 changes: 3 additions & 31 deletions src/native/corehost/fxr/fx_muxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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_definition_t>(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;
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/native/corehost/host_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ enum host_mode_t

apphost, // Invoked as <appname>.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)
Comment thread
elinor-fung marked this conversation as resolved.
};

#define _HOST_INTERFACE_PACK 1
Expand Down
3 changes: 0 additions & 3 deletions src/native/corehost/hostpolicy/hostpolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading