PackageDependency.Create Method

Definition

Overloads

Create(String, PackageVersion)

Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version. When you use this method, the framework package dependency is accessible to the current user only. To create a framework package dependency that is accessible to all users, use the CreateForSystem method instead.

Create(String, PackageVersion, CreatePackageDependencyOptions)

Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version and the specified options. When you use this method, the framework package dependency is accessible to the current user only. To create a framework package dependency that is accessible to all users, use the CreateForSystem method instead.

Create(String, PackageVersion)

Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version. When you use this method, the framework package dependency is accessible to the current user only. To create a framework package dependency that is accessible to all users, use the CreateForSystem method instead.

public:
 static PackageDependency ^ Create(Platform::String ^ packageFamilyName, PackageVersion minVersion);
/// [Windows.Foundation.Metadata.Overload("Create")]
 static PackageDependency Create(winrt::hstring const& packageFamilyName, PackageVersion const& minVersion);
[Windows.Foundation.Metadata.Overload("Create")]
public static PackageDependency Create(string packageFamilyName, PackageVersion minVersion);
function create(packageFamilyName, minVersion)
Public Shared Function Create (packageFamilyName As String, minVersion As PackageVersion) As PackageDependency

Parameters

packageFamilyName
String

Platform::String

winrt::hstring

The package family name of the framework package on which to take dependency.

minVersion
PackageVersion

The minimum version of the framework package on which to take dependency.

Returns

The object that represents the package dependency, and provides members you can use to manage the lifetime of the dependency.

Attributes

Remarks

In your app's installer or during the first run of your app, call this method to specify a set of criteria for a framework package you want to use in your app. This informs the OS that your app has a dependency upon a framework package that meets the specified criteria. If one or more framework packages are installed that meet the criteria, Windows will ensure that at least one of these framework packages will remain installed until the install-time reference is deleted.

For more information, see Use the dynamic dependency API to reference MSIX packages at run time.

See also

Applies to

Create(String, PackageVersion, CreatePackageDependencyOptions)

Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version and the specified options. When you use this method, the framework package dependency is accessible to the current user only. To create a framework package dependency that is accessible to all users, use the CreateForSystem method instead.

public:
 static PackageDependency ^ Create(Platform::String ^ packageFamilyName, PackageVersion minVersion, CreatePackageDependencyOptions ^ options);
/// [Windows.Foundation.Metadata.Overload("Create2")]
 static PackageDependency Create(winrt::hstring const& packageFamilyName, PackageVersion const& minVersion, CreatePackageDependencyOptions const& options);
[Windows.Foundation.Metadata.Overload("Create2")]
public static PackageDependency Create(string packageFamilyName, PackageVersion minVersion, CreatePackageDependencyOptions options);
function create(packageFamilyName, minVersion, options)
Public Shared Function Create (packageFamilyName As String, minVersion As PackageVersion, options As CreatePackageDependencyOptions) As PackageDependency

Parameters

packageFamilyName
String

Platform::String

winrt::hstring

The package family name of the framework package on which to take dependency.

minVersion
PackageVersion

The minimum version of the framework package on which to take dependency.

options
CreatePackageDependencyOptions

Defines additional criteria to specify the framework package you want to use in your app.

Returns

The object that represents the package dependency, and provides members you can use to manage the lifetime of the dependency.

Attributes

Remarks

In your app's installer or during the first run of your app, call this method to specify a set of criteria for a framework package you want to use in your app. This informs the OS that your app has a dependency upon a framework package that meets the specified criteria. If one or more framework packages are installed that meet the criteria, Windows will ensure that at least one of these framework packages will remain installed until the install-time reference is deleted. For more information, see Use the dynamic dependency API to reference MSIX packages at run time.

This function fails if the specified dependency criteria cannot be resolved to a specific package. This package resolution check can be skipped by using the VerifyDependencyResolution is specified for the options parameter. This is useful for installers running as user contexts other than the target user (for example, installers running as LocalSystem).

See also

Applies to