Struct BundlerParameters
- Namespace
- AsmResolver.DotNet.Bundles
- Assembly
- AsmResolver.DotNet.dll
Defines parameters for the .NET application bundler.
public struct BundlerParameters
- Inherited Members
Constructors
BundlerParameters(byte[], string)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
BundlerParameters(byte[], string, IDataSource?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, IDataSource? imageToCopyHeadersFrom)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFromIDataSourceThe binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
BundlerParameters(byte[], string, SubSystem, ResourceDirectory?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, SubSystem subSystem, ResourceDirectory? resources)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
subSystemSubSystemThe subsystem to use in the final Windows PE binary.
resourcesResourceDirectoryThe resources to copy into the final Windows PE binary.
BundlerParameters(byte[], string, PEImage?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, PEImage? imageToCopyHeadersFrom)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFromPEImageThe PE image to copy the headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
BundlerParameters(byte[], string, byte[]?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, byte[]? imageToCopyHeadersFrom)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrombyte[]The binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
BundlerParameters(string, string)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(string appHostTemplatePath, string appBinaryPath)
Parameters
appHostTemplatePathstringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplateor<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native.appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
BundlerParameters(string, string, string?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(string appHostTemplatePath, string appBinaryPath, string? imagePathToCopyHeadersFrom)
Parameters
appHostTemplatePathstringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplateor<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native.appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imagePathToCopyHeadersFromstringThe path to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
Properties
ApplicationBinaryPath
Gets or sets the path to the binary within the bundle that contains the application's entry point.
public string ApplicationBinaryPath { readonly get; set; }
Property Value
ApplicationHostTemplate
Gets or sets the template application hosting binary.
public byte[] ApplicationHostTemplate { readonly get; set; }
Property Value
- byte[]
Remarks
By default, the official implementations of the application host can be found in one of the following installation directories:
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplate<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native
IsArm64Linux
Gets a value indicating whether the bundled executable targets the Linux operating system on ARM64.
public bool IsArm64Linux { readonly get; set; }
Property Value
PathPlaceholder
Gets or sets the path placeholder in ApplicationHostTemplate that will be replaced with the contents of ApplicationBinaryPath.
public byte[] PathPlaceholder { readonly get; set; }
Property Value
- byte[]
Resources
Gets or sets the Win32 resources directory to copy into the final PE executable.
public ResourceDirectory? Resources { readonly get; set; }
Property Value
Remarks
This field is ignored if IsArm64Linux is set to true, or ApplicationHostTemplate
does not contain a proper PE image.
SubSystem
Gets or sets the Windows subsystem the final PE executable should target.
public SubSystem SubSystem { readonly get; set; }
Property Value
Remarks
This field is ignored if IsArm64Linux is set to true, or ApplicationHostTemplate
does not contain a proper PE image.
Methods
FromExistingBundle(byte[], string)
Extracts bundler parameters from an existing packaged bundled PE file.
public static BundlerParameters FromExistingBundle(byte[] originalFile, string appBinaryPath)
Parameters
originalFilebyte[]The raw contents of the original PE file.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
Returns
Remarks
This method uses heuristics to determine the right offsets within the existing apphost bundle file, and is not guaranteed to always produce the right bundler parameters.
FromExistingBundle(byte[], string, string)
Extracts bundler parameters from an existing packaged bundled PE file.
public static BundlerParameters FromExistingBundle(byte[] originalFile, string originalAppBinaryPath, string newAppBinaryPath)
Parameters
originalFilebyte[]The raw contents of the original PE file.
originalAppBinaryPathstringThe original name of the file in the bundle that contains the entry point of the application.
newAppBinaryPathstringThe new name of the file in the bundle that contains the entry point of the application.
Returns
Remarks
This method uses heuristics to determine the right offsets within the existing apphost bundle file, and is not guaranteed to always produce the right bundler parameters.
FromExistingBundle(string, string)
Extracts bundler parameters from an existing packaged bundled PE file.
public static BundlerParameters FromExistingBundle(string originalFile, string appBinaryPath)
Parameters
originalFilestringThe path to the original PE file.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
Returns
Remarks
This method uses heuristics to determine the right offsets within the existing apphost bundle file, and is not guaranteed to always produce the right bundler parameters.
FromTemplate(byte[], string)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(byte[] appHostTemplate, string appBinaryPath)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
Returns
FromTemplate(byte[], string, PEImage?)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(byte[] appHostTemplate, string appBinaryPath, PEImage? imageToCopyHeadersFrom)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFromPEImageThe image to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
Returns
FromTemplate(byte[], string, byte[]?)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(byte[] appHostTemplate, string appBinaryPath, byte[]? imageToCopyHeadersFrom)
Parameters
appHostTemplatebyte[]The application host template file to use.
appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrombyte[]The binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
Returns
FromTemplate(string, string)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(string appHostTemplatePath, string appBinaryPath)
Parameters
appHostTemplatePathstringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplateor<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native.appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
Returns
FromTemplate(string, string, string?)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(string appHostTemplatePath, string appBinaryPath, string? imagePathToCopyHeadersFrom)
Parameters
appHostTemplatePathstringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplateor<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native.appBinaryPathstringThe name of the file in the bundle that contains the entry point of the application.
imagePathToCopyHeadersFromstringThe path to the binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.