Skip to content

Commit

Permalink
Update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
elinor-fung committed Mar 25, 2022
1 parent e563ef5 commit 0ab5f74
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/native/corehost/fxr/fx_muxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ namespace
}
else
{
rc = fx_resolver_t::resolve_frameworks_for_app(host_info, app_config.get_is_multilevel_lookup_disabled(), override_settings, app_config, fx_definitions);
rc = fx_resolver_t::resolve_frameworks_for_app(host_info, app_config.get_is_multilevel_lookup_disabled(), override_settings, app_config, fx_definitions, mode == host_mode_t::muxer ? app_candidate.c_str() : nullptr);
if (rc != StatusCode::Success)
{
return rc;
Expand Down Expand Up @@ -1073,7 +1073,7 @@ int fx_muxer_t::handle_cli(

trace::error(
_X("The command could not be loaded, possibly because:\n")
_X(" * You intended to execute a .NET program:\n")
_X(" * You intended to execute a .NET application:\n")
_X(" The application '%s' does not exist.\n")
_X(" * You intended to execute a .NET SDK command:"),
app_candidate.c_str());
Expand Down
12 changes: 7 additions & 5 deletions src/native/corehost/fxr/fx_resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ StatusCode fx_resolver_t::read_framework(
const runtime_config_t::settings_t& override_settings,
const runtime_config_t & config,
const fx_reference_t * effective_parent_fx_ref,
fx_definition_vector_t & fx_definitions)
fx_definition_vector_t & fx_definitions,
const pal::char_t* app_display_name)
{
// This reconciles duplicate references to minimize the number of resolve retries.
update_newest_references(config);
Expand Down Expand Up @@ -449,7 +450,7 @@ StatusCode fx_resolver_t::read_framework(
_X("\n\n")
_X("App: %s\n")
_X("Architecture: %s"),
host_info.host_path.c_str(),
app_display_name != nullptr ? app_display_name : host_info.host_path.c_str(),
get_arch());
display_missing_framework_error(fx_name, new_effective_fx_ref.get_fx_version(), pal::string_t(), host_info.dotnet_root, disable_multilevel_lookup);
return FrameworkMissingFailure;
Expand Down Expand Up @@ -480,7 +481,7 @@ StatusCode fx_resolver_t::read_framework(
return StatusCode::InvalidConfigFile;
}

rc = read_framework(host_info, disable_multilevel_lookup, override_settings, new_config, &new_effective_fx_ref, fx_definitions);
rc = read_framework(host_info, disable_multilevel_lookup, override_settings, new_config, &new_effective_fx_ref, fx_definitions, app_display_name);
if (rc)
{
break; // Error case
Expand Down Expand Up @@ -523,7 +524,8 @@ StatusCode fx_resolver_t::resolve_frameworks_for_app(
bool disable_multilevel_lookup,
const runtime_config_t::settings_t& override_settings,
const runtime_config_t & app_config,
fx_definition_vector_t & fx_definitions)
fx_definition_vector_t & fx_definitions,
const pal::char_t* app_display_name)
{
fx_resolver_t resolver;

Expand All @@ -533,7 +535,7 @@ StatusCode fx_resolver_t::resolve_frameworks_for_app(
do
{
fx_definitions.resize(1); // Erase any existing frameworks for re-try
rc = resolver.read_framework(host_info, disable_multilevel_lookup, override_settings, app_config, /*effective_parent_fx_ref*/ nullptr, fx_definitions);
rc = resolver.read_framework(host_info, disable_multilevel_lookup, override_settings, app_config, /*effective_parent_fx_ref*/ nullptr, fx_definitions, app_display_name);
} while (rc == StatusCode::FrameworkCompatRetry && retry_count++ < Max_Framework_Resolve_Retries);

assert(retry_count < Max_Framework_Resolve_Retries);
Expand Down
6 changes: 4 additions & 2 deletions src/native/corehost/fxr/fx_resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class fx_resolver_t
bool disable_multilevel_lookup,
const runtime_config_t::settings_t& override_settings,
const runtime_config_t& app_config,
fx_definition_vector_t& fx_definitions);
fx_definition_vector_t& fx_definitions,
const pal::char_t* app_display_name = nullptr);

static bool is_config_compatible_with_frameworks(
const runtime_config_t& config,
Expand All @@ -36,7 +37,8 @@ class fx_resolver_t
const runtime_config_t::settings_t& override_settings,
const runtime_config_t& config,
const fx_reference_t * effective_parent_fx_ref,
fx_definition_vector_t& fx_definitions);
fx_definition_vector_t& fx_definitions,
const pal::char_t* app_display_name);

static StatusCode reconcile_fx_references_helper(
const fx_reference_t& lower_fx_ref,
Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/fxr/fx_resolver.messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void fx_resolver_t::display_missing_framework_error(
_X("Learn about framework resolution:\n")
DOTNET_APP_LAUNCH_FAILED_URL
_X("\n\n")
_X("Download framework:\n")
_X("To install missing framework, download:\n")
_X("%s"),
url.c_str());
}
Expand Down
4 changes: 2 additions & 2 deletions src/native/corehost/host_startup_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct host_startup_info_t
static int get_host_path(int argc, const pal::char_t* argv[], pal::string_t* host_path);

pal::string_t host_path; // The path to the current hosting binary.
pal::string_t dotnet_root; // The path to the framework.
pal::string_t app_path; // For apphost, the path to the app dll; for muxer, not applicable as this information is not yet parsed.
pal::string_t dotnet_root; // The path to the .NET install.
pal::string_t app_path; // For apphost, the path to the app dll. For muxer, this is invalid and does not point to the app (the app path is not yet parsed).
};

#endif // __HOST_STARTUP_INFO_H_

0 comments on commit 0ab5f74

Please sign in to comment.