Share via


PackageDependency Class

Definition

Represents a framework package on which the current app has a dependency, and includes members you can use to manage the lifetime of the dependency.

public ref class PackageDependency sealed
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class PackageDependency final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.ApplicationModel.DynamicDependency.DynamicDependencyContract, 65536)]
class PackageDependency final
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public sealed class PackageDependency
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.ApplicationModel.DynamicDependency.DynamicDependencyContract), 65536)]
public sealed class PackageDependency
Public NotInheritable Class PackageDependency
Inheritance
Object Platform::Object IInspectable PackageDependency
Attributes

Remarks

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

Properties

GenerationId

Gets the package graph's current generation ID.

Id

Gets the ID of the package dependency. This value is available after successful calls to the Create and CreateForSystem methods.

PackageGraphRevisionId

Gets the package graph's current generation ID.

Methods

Add()

Adds a run-time reference for the framework package dependency you created earlier by using the Create method. After this method successfully returns, your app may activate types and use content from the framework package.

Add(AddPackageDependencyOptions)

Adds a run-time reference for the framework package dependency you created earlier by using the Create method, with the specified options. After this method successfully returns, your app can activate types and use content from the framework package.

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.

CreateForSystem(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. This method creates a framework package dependency that is accessible to all users, and this method requires that the caller has administrative privileges. To create a framework package dependency that is accessible only to the current user, use the Create method instead.

Delete()

Deletes the install-time reference for the framework package dependency you created earlier by using the Create method. This method informs the OS that it is safe to remove the framework package if no other apps have a dependency on it.

GetFromId(String)

Creates a new package dependency instance from the specified package dependency ID.

GetFromIdForSystem(String)

Creates a new package dependency instance from the specified package dependency ID. The package dependency is accessible to all users, , and this method requires that the caller has administrative privileges.

Applies to

See also