Add support for framework-dependent apphost #3888
Conversation
f9b228a
to
4c507ea
Compare
pal::char_t* program_files_dir; | ||
if (pal::is_running_in_wow64()) | ||
{ | ||
program_files_dir = _X("ProgramFiles(x86)"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
That's not the process. The process is get the code checked into master, and then port the change to the release branch. |
SetStartupConfigJson(startupConfigPath, relativeNewPath); | ||
|
||
// TODO: Use FS.Chmod when build utility project is converted to csproj. | ||
// See https://github.com/NuGet/Home/issues/4424 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
|
||
[Fact] | ||
public void Running_Publish_Output_Standalone_EXE_With_Startupconfig_Succeeds() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -223,6 +226,8 @@ namespace pal | |||
bool load_library(const string_t* path, dll_t* dll); | |||
proc_t get_symbol(dll_t library, const char* name); | |||
void unload_library(dll_t library); | |||
|
|||
bool is_running_in_wow64(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
init->host_info.host_path = input->host_info_host_path; | ||
init->host_info.dotnet_root = input->host_info_dotnet_root; | ||
init->host_info.app_path = input->host_info_app_path; | ||
// For the backwards compat case, this will be later initialized with argv[0] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/corehost/cli/fxr/fx_muxer.cpp
Outdated
known_opts.push_back({ _X("--runtimeconfig"), _X("<path>"), _X("Path to <application>.runtimeconfig.json file") }); | ||
known_opts.push_back({ _X("--depsfile"), _X("<path>"), _X("Path to <application>.deps.json file")}); | ||
known_opts.push_back({ _X("--runtimeconfig"), _X("<path>"), _X("Path to <application>.runtimeconfig.json file")}); | ||
known_opts.push_back({ _X("--dotnet-path"), _X("<path>"), _X("Path to the installed Shared Framework to use to run the application.")}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
known_opts.push_back({ _X("--fx-version"), _X("<version>"), _X("Version of the installed Shared Framework to use to run the application.") }); | ||
known_opts.push_back({ _X("--roll-forward-on-no-candidate-fx"), _X(""), _X("Roll forward on no candidate shared framework is enabled") }); | ||
known_opts.push_back({ _X("--additional-deps"), _X("<path>"), _X("Path to additonal deps.json file") }); | ||
// If mode=host_mode_t::apphost, these are only used when the app is framework-dependent. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
// These settings are only valid for framework-dependent apps | ||
if (is_framework_dependent) | ||
{ | ||
fx_version_specified = get_last_known_arg(opts, opts_fx_version, _X("")); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
|
||
// No FX resolution for mixed apps | ||
if (mode == host_mode_t::split_fx) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
|
||
trace::error(_X("A fatal error occurred, the required library %s could not be found at [%s]"), LIBFXR_NAME, own_dir.c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
New functionality for the apphost (
<myapp>.exe
) including:%DOTNET_ROOT%
environment variable. This environment variable is only used by apphost. The default locations otherwise are%ProgramFiles%
(Windows),/usr/share/dotnet
(Unix),/usr/local/share/dotnet
(OSX)Fixes https://github.com/dotnet/core-setup/issues/3720
Additional documentation will be provided describing the new functionality and runtimeconfig.json format.
Note for Windows Wow64 support (x86 on 64-bit), the default location is
%ProgramFiles(x86)%
and the new environment variable is%DOTNET_ROOT(x86)%
Automated tests are limited until we get tooling support.
The apphost now uses the casablanca json parser for startupconfig.json. I may work on removing that dependency and using simple file I\O instead to save on exe size (details pending)
cc @wli3