| title | Bootstrap class |
|---|---|
| description | The **Bootstrap** class contains static helper methods that conveniently wrap calls to the [Bootstrapper API](/windows/windows-app-sdk/api/win32/_bootstrap/). |
| ms.topic | how-to |
| ms.date | 04/05/2022 |
| keywords | windows 10, windows 11, Windows App SDK, desktop development, C#, interop, Bootstrapper, Bootstrapper API |
| ms.localizationpriority | low |
The Bootstrap class contains static helper methods that conveniently wrap calls to the Bootstrapper API.
Namespace: Microsoft.Windows.ApplicationModel.DynamicDependency
Assembly: Microsoft.WindowsAppRuntime.Bootstrap.Net.dll
public class BootstrapInitializes the calling process to use Windows App SDK's framework package. Finds a Windows App SDK framework package meeting the criteria provided in the arguments, and makes it available for use by the current process. If multiple packages meet the criteria, then the best candidate is selected.
public static void Initialize(uint majorMinorVersion);
public static void Initialize(uint majorMinorVersion, string versionTag);
public static void Initialize(uint majorMinorVersion, string versionTag, PackageVersion minVersion);majorMinorVersion uint
The major and minor version of the Windows App SDK framework package to load. The version is encoded as 0xMMMMNNNN, where M = Major and N = Minor (for example, version 1.2 should be encoded as 0x00010002).
versionTag string
The version tag of the Windows App SDK framework package to load (if any). For example, "prerelease". Defaults to null.
minVersion PackageVersion
The minimum version of the Windows App SDK framework package to use. Defaults to a new default instance of PackageVersion.
Removes the changes made to the current process by Initialize or TryInitialize. After Shutdown is called, your app can no longer call Windows App SDK APIs, including the Dynamic dependency API.
public static void Shutdown();Initializes the calling process to use Windows App SDK's framework package. Failure returns false with the failure HRESULT in the hresult parameter. Finds a Windows App SDK framework package meeting the criteria provided in the arguments, and makes it available for use by the current process. If multiple packages meet the criteria, then the best candidate is selected.
public static bool TryInitialize(uint majorMinorVersion, out int hresult);
public static bool TryInitialize(uint majorMinorVersion, string versionTag, out int hresult);
public static bool TryInitialize(uint majorMinorVersion, string versionTag, PackageVersion minVersion, out int hresult);majorMinorVersion uint
The major and minor version of the Windows App SDK framework package to load. The version is encoded as 0xMMMMNNNN, where M = Major and N = Minor (for example, version 1.2 should be encoded as 0x00010002).
hresult uint
The failure HRESULT, if the initialization failed.
versionTag string
The version tag of the Windows App SDK framework package to load (if any). For example, "prerelease". Defaults to null.
minVersion PackageVersion
The minimum version of the Windows App SDK framework package to use. Defaults to a new default instance of PackageVersion.
| Product | Introduced in |
|---|---|
| Windows App SDK | Windows App SDK 1.0 |