pub struct Hostfxr(pub Rc<Container<HostfxrLib>>);
Expand description

A struct representing a loaded hostfxr library.

Tuple Fields

0: Rc<Container<HostfxrLib>>

Implementations

Loads the hostfxr library from the given path.

Locates the hostfxr library using nethost and loads it.

Initializes the hosting components for a dotnet command line running an application

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • app_path: The path to the target application.
Remarks

This function parses the specified command-line arguments to determine the application to run. It will then find the corresponding .runtimeconfig.json and .deps.json with which to resolve frameworks and dependencies and prepare everything needed to load the runtime.

Initializes the hosting components for a dotnet command line running an application

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • app_path: The path to the target application.
  • host_path: Path to the native host (typically the .exe). This value is not used for anything by the hosting components. It’s just passed to the CoreCLR as the path to the executable. It can point to a file which is not executable itself, if such file doesn’t exist (for example in COM activation scenarios this points to the comhost.dll). This is used by PAL to initialize internal command line structures, process name and so on.
Remarks

This function parses the specified command-line arguments to determine the application to run. It will then find the corresponding .runtimeconfig.json and .deps.json with which to resolve frameworks and dependencies and prepare everything needed to load the runtime.

Initializes the hosting components for a dotnet command line running an application

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • app_path: The path to the target application.
  • dotnet_root: Path to the root of the .NET Core installation in use. This typically points to the install location from which the hostfxr has been loaded. For example on Windows this would typically point to C:\Program Files\dotnet. The path is used to search for shared frameworks and potentially SDKs.
Remarks

This function parses the specified command-line arguments to determine the application to run. It will then find the corresponding .runtimeconfig.json and .deps.json with which to resolve frameworks and dependencies and prepare everything needed to load the runtime.

Initializes the hosting components for a dotnet command line running an application

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • args: The command line for running a managed application. These represent the arguments which would have been passed to the muxer if the app was being run from the command line. Note that the first argument has to be the path of the target app.
Remarks

This function parses the specified command-line arguments to determine the application to run. It will then find the corresponding .runtimeconfig.json and .deps.json with which to resolve frameworks and dependencies and prepare everything needed to load the runtime.

Initializes the hosting components for a dotnet command line running an application

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • args: The command line for running a managed application. These represent the arguments which would have been passed to the muxer if the app was being run from the command line. Note that the first argument has to be the path of the target app.
  • host_path: Path to the native host (typically the .exe). This value is not used for anything by the hosting components. It’s just passed to the CoreCLR as the path to the executable. It can point to a file which is not executable itself, if such file doesn’t exist (for example in COM activation scenarios this points to the comhost.dll). This is used by PAL to initialize internal command line structures, process name and so on.
Remarks

This function parses the specified command-line arguments to determine the application to run. It will then find the corresponding .runtimeconfig.json and .deps.json with which to resolve frameworks and dependencies and prepare everything needed to load the runtime.

Initializes the hosting components for a dotnet command line running an application

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • args: The command line for running a managed application. These represent the arguments which would have been passed to the muxer if the app was being run from the command line. Note that the first argument has to be the path of the target app.
  • dotnet_root: Path to the root of the .NET Core installation in use. This typically points to the install location from which the hostfxr has been loaded. For example on Windows this would typically point to C:\Program Files\dotnet. The path is used to search for shared frameworks and potentially SDKs.
Remarks

This function parses the specified command-line arguments to determine the application to run. It will then find the corresponding .runtimeconfig.json and .deps.json with which to resolve frameworks and dependencies and prepare everything needed to load the runtime.

This function loads the specified .runtimeconfig.json, resolve all frameworks, resolve all the assets from those frameworks and then prepare runtime initialization where the TPA contains only frameworks. Note that this case does NOT consume any .deps.json from the app/component (only processes the framework’s .deps.json).

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • runtime_config_path: Path to the .runtimeconfig.json file to process. Unlike with initialize_for_dotnet_command_line, any .deps.json from the app/component will not be processed by the hosting layers.

This function loads the specified .runtimeconfig.json, resolve all frameworks, resolve all the assets from those frameworks and then prepare runtime initialization where the TPA contains only frameworks. Note that this case does NOT consume any .deps.json from the app/component (only processes the framework’s .deps.json).

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • runtime_config_path: Path to the .runtimeconfig.json file to process. Unlike with initialize_for_dotnet_command_line, any .deps.json from the app/component will not be processed by the hosting layers.
  • host_path: Path to the native host (typically the .exe). This value is not used for anything by the hosting components. It’s just passed to the CoreCLR as the path to the executable. It can point to a file which is not executable itself, if such file doesn’t exist (for example in COM activation scenarios this points to the comhost.dll). This is used by PAL to initialize internal command line structures, process name and so on.

This function loads the specified .runtimeconfig.json, resolve all frameworks, resolve all the assets from those frameworks and then prepare runtime initialization where the TPA contains only frameworks. Note that this case does NOT consume any .deps.json from the app/component (only processes the framework’s .deps.json).

Like all the other initialize functions, this function will

  • Process the .runtimeconfig.json
  • Resolve framework references and find actual frameworks
  • Find the root framework (Microsoft.NETCore.App) and load the hostpolicy from it
  • The hostpolicy will then process all relevant .deps.json files and produce the list of assemblies, native search paths and other artifacts needed to initialize the runtime.

The functions will NOT load the CoreCLR runtime. They just prepare everything to the point where it can be loaded.

Arguments
  • runtime_config_path: Path to the .runtimeconfig.json file to process. Unlike with initialize_for_dotnet_command_line, any .deps.json from the app/component will not be processed by the hosting layers.
  • dotnet_root: Path to the root of the .NET Core installation in use. This typically points to the install location from which the hostfxr has been loaded. For example on Windows this would typically point to C:\Program Files\dotnet. The path is used to search for shared frameworks and potentially SDKs.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.